-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c9f2ef
commit 5ab9709
Showing
16 changed files
with
274 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: goenv | ||
|
||
on: | ||
push: | ||
branches: [ $default-branch ] | ||
pull_request: | ||
branches: [ $default-branch ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Run pre-commit hook | ||
run: ./.githooks/pre-commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
FROM ubuntu:latest | ||
FROM drewgonzales360/drew:latest | ||
|
||
COPY goenv /usr/local/bin | ||
|
||
RUN \ | ||
apt-get update \ | ||
&& apt-get install -y ca-certificates | ||
COPY scripts/goenv-test.sh /usr/local/bin/goenv-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Alfred | ||
# goenv | ||
|
||
Alfred is a template for Go projects that we can use in the future. It sets up a _very_ basic CLI. | ||
![example workflow](https://github.com/drewgonzales360/goenv/actions/workflows/github-actions.yml/badge.svg) | ||
|
||
goenv is an small, simple binary that executes the [install instructions](https://go.dev/doc/install) on the Go website. There are several other implementations that have much more support. This has fewer features and is only meant to serve me. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package pkg | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
const ( | ||
colorRed string = "\033[31m" | ||
colorGreen string = "\033[32m" | ||
colorReset string = "\033[0m" | ||
) | ||
|
||
func Success(mesg string) { | ||
fmt.Printf("😎 %s%s%s\n", colorGreen, mesg, colorReset) | ||
} | ||
|
||
func Fail(mesg string) { | ||
fmt.Printf("😭 %s%s%s\n", colorRed, mesg, colorReset) | ||
} | ||
|
||
func Debug(mesg string) { | ||
logLevel := os.Getenv("GOENV_LOG") | ||
if logLevel == "DEBUG" { | ||
fmt.Printf("🤔 %s%s%s\n", colorRed, mesg, colorReset) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package pkg | ||
|
||
import ( | ||
"os" | ||
"time" | ||
) | ||
|
||
func CheckRW() []string { | ||
accessDenied := []string{} | ||
currentTime := time.Now().Local() | ||
|
||
installDirectory := "/usr/local/" | ||
if err := os.Chtimes(installDirectory, currentTime, currentTime); err != nil { | ||
Debug(err.Error()) | ||
accessDenied = append(accessDenied, installDirectory) | ||
} | ||
|
||
binDirectory := "/usr/local/bin/" | ||
if err := os.Chtimes(binDirectory, currentTime, currentTime); err != nil { | ||
Debug(err.Error()) | ||
accessDenied = append(accessDenied, binDirectory) | ||
} | ||
|
||
return accessDenied | ||
} |
Oops, something went wrong.