Merge pull request #5 from gabrie30/async

Async
This commit is contained in:
Jay Gabriels
2018-03-30 07:41:55 -07:00
committed by GitHub
2 changed files with 9 additions and 3 deletions

View File

@@ -6,6 +6,12 @@ Github search is terrible. The idea here is quickly clone all org repos into a s
### Use
- `$ ghorg nameoforg`
### Setup
1. `git clone`
1. `cd ghorg`
1. `$cp .env-sample .env`
2. update .env
3. `$ go install`
### Auth
- `$cp .env-sample .env` add your personal access token
- 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/

View File

@@ -46,7 +46,7 @@ func getAllOrgCloneUrls() ([]string, error) {
return cloneUrls, nil
}
func CreateDirIfNotExist() {
func createDirIfNotExist() {
clonePath := os.Getenv("ABSOLUTE_PATH_TO_CLONE_TO")
if _, err := os.Stat(clonePath); os.IsNotExist(err) {
err = os.MkdirAll(clonePath, 0755)
@@ -73,7 +73,7 @@ func getAppNameFromURL(url string) string {
// CloneAllReposByOrg clones all repos for a given org
func CloneAllReposByOrg() {
resc, errc := make(chan string), make(chan error)
CreateDirIfNotExist()
createDirIfNotExist()
cloneTargets, err := getAllOrgCloneUrls()
if err != nil {