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()) log.Warn("something went wrong with the release.version:", me.release.version.String())
return false return false
} }
me.done = append(me.done, me.current.GetGoPath())
if strings.HasPrefix(me.release.version.String(), "v") { if strings.HasPrefix(me.release.version.String(), "v") {
log.Warn("everything is ok. version starts with v.", me.release.version.String()) log.Warn("everything is ok. version starts with v.", me.release.version.String())
} else { } else {

View File

@ -108,6 +108,16 @@ func rePrepareRelease() {
continue 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.Quick != nil {
// if argv has 'quick' don't do anything // if argv has 'quick' don't do anything
// that doesn't actually have a patch // that doesn't actually have a patch
@ -139,3 +149,12 @@ func rePrepareRelease() {
} }
me.forge.PrintHumanTable(me.found) 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

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