make devel and user branches locally

This commit is contained in:
Jeff Carr 2024-12-13 16:17:36 -06:00
parent 6ea78a6e8b
commit 2b090019a9
2 changed files with 27 additions and 3 deletions

View File

@ -35,22 +35,43 @@ func doGitPull() {
} }
func doFix() { func doFix() {
var fixed bool = false
all := me.found.SortByGoPath() all := me.found.SortByGoPath()
for all.Scan() { for all.Scan() {
repo := all.Next() repo := all.Next()
if !repo.IsValid() { if !repo.IsValid() {
log.Printf("%10s %-50s", "old?\n", repo.GoPath) log.Printf("%10s %-50s", "old?\n", repo.GoPath)
me.forge.Repos.DeleteByGoPath(repo.GoPath) me.forge.Repos.DeleteByGoPath(repo.GoPath)
fixed = true configSave = true
continue continue
} }
log.Printf("running on: %-50s\n", repo.GetGoPath()) log.Printf("running on: %-50s\n", repo.GetGoPath())
cmd := []string{"ls"} cmd := []string{"ls"}
repo.Run(cmd) repo.Run(cmd)
if err := checkoutBranches(repo); err != nil {
badExit(err)
} }
if fixed { }
if configSave {
me.forge.Repos.ConfigSave() me.forge.Repos.ConfigSave()
okExit("config saved") 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
}

View File

@ -15,6 +15,9 @@ import (
var VERSION string var VERSION string
var BUILDTIME string var BUILDTIME string
// using this for now. triggers config save
var configSave bool
func main() { func main() {
me = new(mainType) me = new(mainType)
me.pp = arg.MustParse(&argv) me.pp = arg.MustParse(&argv)