add makefile

This commit is contained in:
Jay Gabriels
2018-04-21 20:22:18 -07:00
parent 2cfe213096
commit 2d54f689f1
3 changed files with 16 additions and 10 deletions

3
Makefile Normal file
View File

@@ -0,0 +1,3 @@
install:
touch ~/.ghorg
cp .env ~/.ghorg

View File

@@ -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 <https://github.com/wrsinc/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 <https://github.com/wrsinc/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/)

View File

@@ -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")
}
}