double check finished repos

This commit is contained in:
Jeff Carr 2025-01-17 14:19:26 -06:00
parent 68ee252acd
commit ab73c05b9d
3 changed files with 31 additions and 10 deletions

View File

@ -23,6 +23,8 @@ func doRelease() bool {
log.Warn("something went wrong with the release.version:", me.release.version.String())
return false
}
me.done = append(me.done, me.current.GetGoPath())
if strings.HasPrefix(me.release.version.String(), "v") {
log.Warn("everything is ok. version starts with v.", me.release.version.String())
} else {

View File

@ -108,6 +108,16 @@ func rePrepareRelease() {
continue
}
if alreadyDone(check) {
// means it was already published
// protects against logic errors that might result
// in an infinite loop
log.Info("WARNING already done", check.GetGoPath())
log.Info("WARNING already done", check.GetGoPath())
log.Info("WARNING already done", check.GetGoPath())
continue
}
if argv.Quick != nil {
// if argv has 'quick' don't do anything
// that doesn't actually have a patch
@ -139,3 +149,12 @@ func rePrepareRelease() {
}
me.forge.PrintHumanTable(me.found)
}
func alreadyDone(repo *gitpb.Repo) bool {
for _, gopath := range me.done {
if repo.GetGoPath() == gopath {
return true
}
}
return false
}

View File

@ -12,16 +12,16 @@ import (
var me *autoType
type autoType struct {
pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
myGui *gui.Node
releaseReasonS string // = "gocui dropdown select"
release releaseStruct
reposbox *gui.Node
reposgrid *gui.Node
reposgroup *gui.Node
current *gitpb.Repo
found *gitpb.Repos // stores the list of repos to process things on
pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
myGui *gui.Node // the gui handle itself
releaseReasonS string // = "gocui dropdown select"
release releaseStruct // notsure
reposbox *gui.Node // notsure
reposgrid *gui.Node // notsure
reposgroup *gui.Node // notsure
current *gitpb.Repo // tracks the next repo to publish
found *gitpb.Repos // stores the list of repos to process things on
done []string // gopaths for repos already published
// this is the repo we are starting in
// make sure it never changes so go.mod and go.sum are always there