diff options
| author | Jeff Carr <[email protected]> | 2024-12-13 16:17:36 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-13 16:17:36 -0600 |
| commit | 2b090019a9149bf89f883c46786476ef8a827069 (patch) | |
| tree | ba8ee90c1f37535583eb3c02a4a0bc998051a3c8 /doCommon.go | |
| parent | 6ea78a6e8ba73e98a396e03b9231bd2d6a9a5288 (diff) | |
make devel and user branches locally
Diffstat (limited to 'doCommon.go')
| -rw-r--r-- | doCommon.go | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/doCommon.go b/doCommon.go index 85beb01..296f1cb 100644 --- a/doCommon.go +++ b/doCommon.go @@ -35,22 +35,43 @@ func doGitPull() { } func doFix() { - var fixed bool = false all := me.found.SortByGoPath() for all.Scan() { repo := all.Next() if !repo.IsValid() { log.Printf("%10s %-50s", "old?\n", repo.GoPath) me.forge.Repos.DeleteByGoPath(repo.GoPath) - fixed = true + configSave = true continue } log.Printf("running on: %-50s\n", repo.GetGoPath()) cmd := []string{"ls"} repo.Run(cmd) + if err := checkoutBranches(repo); err != nil { + badExit(err) + } } - if fixed { + if configSave { me.forge.Repos.ConfigSave() okExit("config saved") } } + +func checkoutBranches(repo *gitpb.Repo) error { + dname := repo.GetDevelBranchName() + if dname == "" { + if err := me.forge.MakeDevelBranch(repo); err != nil { + log.Info("verify() no devel branch name", repo.GoPath) + return err + } + configSave = true + } + if repo.GetUserBranchName() == "" { + if err := me.forge.MakeUserBranch(repo); err != nil { + log.Info("verify() no devel branch name", repo.GoPath) + return err + } + configSave = true + } + return nil +} |
