diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a53f038 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +install: + touch ~/.ghorg + cp .env ~/.ghorg diff --git a/README.md b/README.md index 34191ba..f51fa51 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,18 @@ # ghorg ### Purpose -Github search is terrible. The idea here is quickly clone all org repos into a single directory and use something like ack for searching. Can also be used for setting up kuve +Github search is terrible. The idea here is quickly clone all org repos into a single directory and use something like ack for searching the org. Can also be used for setting up kuve ### Use `$ ghorg nameoforg` ### Setup -1. `$ git clone` -1. `$ cd ghorg` -1. `$cp .env-sample .env` -2. update .env -3. `$ go install` +1. $ git clone +1. $ cd ghorg +1. $cp .env-sample .env +2. update your .env +2. $ make install +3. $ go install ### Auth -- If org is behind SSO add it to the token https://help.github.com/articles/authorizing-a-personal-access-token-for-use-with-a-saml-single-sign-on-organization/ +- If org is behind SSO add it to the [Github token](https://help.github.com/articles/authorizing-a-personal-access-token-for-use-with-a-saml-single-sign-on-organization/) diff --git a/main.go b/main.go index e2f2388..4067c63 100644 --- a/main.go +++ b/main.go @@ -3,8 +3,9 @@ package main import ( "fmt" "log" + "os" - "github.com/ghorg/cmd" + "github.com/gabrie30/ghorg/cmd" "github.com/joho/godotenv" ) @@ -14,8 +15,9 @@ func main() { } func init() { - err := godotenv.Load() + home := os.Getenv("HOME") + err := godotenv.Load(home + "/.ghorg") if err != nil { - log.Fatal("Error loading .env file") + log.Fatal("Error loading .ghorg file, create a .env from the sample and run Make install") } }