releaser went through the whole process this time

This commit is contained in:
Jeff Carr 2025-09-04 12:34:37 -05:00
parent 09d595fd53
commit 27b10fdc73
2 changed files with 53 additions and 35 deletions

View File

@ -200,26 +200,6 @@ func doRelease() error {
}
log.Info("EVERYTHING OK. RERELEASED", me.current.GetGoPath())
return skipToNext()
}
func skipToNext() error {
me.current.Reload()
me.forge.SetConfigSave(true)
me.forge.ConfigSave()
log.Info("sleep 2")
time.Sleep(2 * time.Second)
printDone()
rePrepareRelease()
findNext()
if me.current == nil {
log.Info("NOT GOOD TO RUN ANOTHER DAY")
log.Info("took out all the loop code")
setCurrentRepo(nil, "loop by hand motherfucker", "fucknuts")
return fmt.Errorf("findNext returned next repo == nil")
}
log.Info("GOOD TO RUN ANOTHER DAY ON:", me.current.GetGoPath())
return nil
}

View File

@ -2,11 +2,17 @@
package main
import (
"fmt"
"time"
"go.wit.com/gui"
"go.wit.com/log"
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/repolist"
"go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
)
type releaseStruct struct {
@ -122,26 +128,58 @@ func createReleaseBox(box *gui.Node) {
grid = group.NewGrid("buildOptions", 0, 0)
grid.NewButton("doRelease() all", func() {
buttonDisable()
count := 0
for {
log.Info("START doRelease() LOOP count =", count, "len me.done =", len(me.done))
if err := doRelease(); err != nil {
break
}
me.forge.CheckDirty()
count += 1
// never allow a loop longer than all the known repos
// this probably doesn't matter, but often this code is wrong
if count > me.forge.Repos.Len() {
// so this is a safety check. never remove this check.
break
}
}
doReleaseAll()
buttonEnable()
})
grid.NextRow()
}
func doReleaseAll() {
count := 0
for {
log.Info("START doRelease() LOOP count =", count, "len me.done =", len(me.done))
if err := doRelease(); err != nil {
break
}
if err := skipToNext(); err != nil {
break
}
count += 1
if count > me.forge.Repos.Len() {
// never allow a loop longer than all the known repos
// this probably doesn't matter, but often this code is wrong
// so this is a safety check. never remove this check.
break
}
}
}
func skipToNext() error {
shell.RunVerbose([]string{"forge", "dirty"})
log.Info("Sleeping for 10 seconds. Forge file should have been rewritten")
time.Sleep(10)
me.forge = forgepb.Init()
me.found = new(gitpb.Repos)
me.current.Reload()
me.forge.SetConfigSave(true)
me.forge.ConfigSave()
log.Info("sleep 2")
time.Sleep(2 * time.Second)
printDone()
rePrepareRelease()
findNext()
if me.current == nil {
log.Info("NOT GOOD TO RUN ANOTHER DAY")
log.Info("took out all the loop code")
setCurrentRepo(nil, "loop by hand motherfucker", "fucknuts")
return fmt.Errorf("findNext returned next repo == nil")
}
log.Info("GOOD TO RUN ANOTHER DAY ON:", me.current.GetGoPath())
return nil
}
func buttonDisable() {
me.Disable()
me.release.box.Disable()