mirror of
https://github.com/outbackdingo/ghorg.git
synced 2026-01-27 10:19:03 +00:00
@@ -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/
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user