save Published() go deps

This commit is contained in:
Jeff Carr 2024-12-01 12:53:08 -06:00
parent d132639049
commit 339c88ccbd
2 changed files with 46 additions and 0 deletions

View File

@ -48,6 +48,11 @@ func (f *Forge) Build(repo *gitpb.Repo, userFlags []string) error {
t := loop1.Next()
log.Info("Build() dep:", t.GetGoPath(), t.GetVersion())
}
loop2 := repo.Published.SortByGoPath()
for loop2.Scan() {
t := loop2.Next()
log.Info("Build() pub:", t.GetGoPath(), t.GetVersion())
}
log.Info("Build() dep len:", repo.GoDeps.Len())
os.Exit(-1)

View File

@ -45,3 +45,44 @@ func (f *Forge) NewGoPath(gopath string) (*gitpb.Repo, error) {
// return newr, err
}
func (f *Forge) VerifyBranchNames(newr *gitpb.Repo) {
// log.Info("init worked for", newr.GoPath)
if newr.GetMasterBranchName() == "" {
// try to guess what the 'master' branch is
if newr.IsBranch("guimaster") {
newr.SetMasterBranchName("guimaster")
} else if newr.IsBranch("master") {
newr.SetMasterBranchName("master")
} else if newr.IsBranch("main") {
newr.SetMasterBranchName("main")
} else {
newr.SetMasterBranchName("masterFIXME")
}
}
if f.IsReadOnly(newr.GoPath) {
return
}
if newr.GetDevelBranchName() == "" {
if newr.IsBranch("guidevel") {
newr.SetDevelBranchName("guidevel")
} else if newr.IsBranch("devel") {
newr.SetDevelBranchName("devel")
} else {
newr.SetDevelBranchName("develFIXME")
}
}
if newr.GetUserBranchName() == "" {
usr, _ := user.Current()
uname := usr.Username
if newr.IsBranch(uname) {
newr.SetUserBranchName(uname)
} else {
newr.SetUserBranchName(uname + "FIXME")
}
}
}