Skip to content

Commit

Permalink
Update fmt formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
xbglowx committed Nov 11, 2021
1 parent 0bd0c4f commit 1efcbfb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cmd/github-org-sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (gh *GhOrgSync) cloneRepo(sem chan struct{}, repo *github.Repository) {
fmt.Printf("Cloning repo %s to %s%s\n", repo.GetName(), gh.destPath, repo.GetName())
err := cmd.Run()
if err != nil {
fmt.Printf("***ERROR***: Repo %s failed to clone: %v\n", repo.GetName(), err)
fmt.Printf("ERROR: Repo %s failed to clone: %v\n", repo.GetName(), err)
}
}

Expand Down Expand Up @@ -114,12 +114,12 @@ func (gh *GhOrgSync) updateLocalRepo(sem chan struct{}, repo *github.Repository)

repoPath := fmt.Sprintf("%s%s", gh.destPath, repo.GetName())
if gitDirtyBranch(fmt.Sprintf("%s%s", gh.destPath, repo.GetName())) {
fmt.Printf("%s is dirty, so stashing first", repoPath)
fmt.Printf("INFO: %s is dirty, so stashing first\n", repoPath)
gitStashCmd := strings.Fields(fmt.Sprintf("git -C %s stash push", repoPath))
cmd := exec.Command(gitStashCmd[0], gitStashCmd[1:]...)
err := cmd.Run()
if err != nil {
fmt.Printf("***ERROR***: Repo %s is dirty but failed to stash: %s\n", repo.GetName(), err)
fmt.Printf("ERROR: Repo %s is dirty but failed to stash: %s\n", repo.GetName(), err)
}
}

Expand All @@ -128,15 +128,15 @@ func (gh *GhOrgSync) updateLocalRepo(sem chan struct{}, repo *github.Repository)
cmd := exec.Command(gitCheckoutCmd[0], gitCheckoutCmd[1:]...)
err := cmd.Run()
if err != nil {
fmt.Printf("***ERROR***: Failed to checkout default branch %s for repo %s: %s\n", *defaultBranch, repo.GetName(), err)
fmt.Printf("ERROR: Failed to checkout default branch %s for repo %s: %s\n", *defaultBranch, repo.GetName(), err)
}

gitUpdateCmd := strings.Fields(fmt.Sprintf("git -C %s pull --rebase", repoPath))
cmd = exec.Command(gitUpdateCmd[0], gitUpdateCmd[1:]...)
fmt.Printf("Updating repo %s%s\n", gh.destPath, repo.GetName())
err = cmd.Run()
if err != nil {
fmt.Printf("***ERROR***: Repo %s failed to update: %v\n", repo.GetName(), err)
fmt.Printf("ERROR: Repo %s failed to update: %v\n", repo.GetName(), err)
}
}

Expand All @@ -156,10 +156,10 @@ func main(args []string) {

for _, repo := range repos {
if *repo.Archived && skipArchived {
fmt.Printf("Not including %s since you asked to skip any archived repos\n", repo.GetName())
fmt.Printf("INFO: Not including %s since you asked to skip any archived repos\n", repo.GetName())
continue
} else if !repo.Permissions["pull"] {
fmt.Printf("Not including %s since you don't have pull permission\n", repo.GetName())
fmt.Printf("WARNING: Not including %s since you don't have pull permission\n", repo.GetName())
continue
} else {
gh.wg.Add(1)
Expand Down

0 comments on commit 1efcbfb

Please sign in to comment.