more checks

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-30 14:40:41 -06:00
parent c401c60399
commit a3a1c09005
3 changed files with 68 additions and 12 deletions

48
checkReady.go Normal file
View File

@ -0,0 +1,48 @@
// This is a simple example
package main
import (
"go.wit.com/log"
)
func CheckReady() bool {
if release.current == nil {
log.Info("find the next repo first")
return false
}
goSumS := release.current.getGoSumStatus()
dirtyS := release.current.dirtyLabel.String()
lastS := release.current.status.GetLastTagVersion()
log.Info("repo:", release.current.String(), goSumS, dirtyS, lastS)
if dirtyS == "ready to tag version" {
log.Info("\trepo is ready", release.current.String(), goSumS, dirtyS, lastS)
} else {
return false
}
if release.current.status.ReadOnly() {
log.Info("\trepo is read only")
return false
}
if release.versionS == lastS {
log.Info("\trepo is already done")
return false
}
if goSumS == "BAD" {
log.Info("\trepo is ready", release.current.String(), goSumS, dirtyS, lastS)
} else {
log.Info("\trepo is ready maybe", release.current.String(), goSumS, dirtyS, lastS)
}
if release.current.status.CheckDirty() {
log.Info("\trepo is dirty")
return false
} else {
log.Info("\trepo is ready", release.current.String(), goSumS, dirtyS, lastS)
}
return true
}

View File

@ -27,7 +27,9 @@ type releaseStruct struct {
readOnly *gadgets.OneLiner
notes *gadgets.OneLiner
version *gadgets.OneLiner
versionS string
reason *gadgets.BasicEntry
reasonS string
openrepo *gui.Node
@ -48,9 +50,9 @@ func (w *autoType) Enable() {
}
func createReleaseBox(box *gui.Node) {
versionS := "0.17.0"
reasonS := "gocui"
partS := strings.Split(versionS, ".")
release.versionS = "0.17.0"
release.reasonS = "gocui"
partS := strings.Split(release.versionS, ".")
release.box = box
release.group = release.box.NewGroup("things")
@ -68,7 +70,7 @@ func createReleaseBox(box *gui.Node) {
}
me.Enable()
})
release.grid.NewButton("find next Bad", func() {
release.grid.NewButton("findNextDirty()", func() {
me.Disable()
if findNextDirty() {
log.Info("findNextDirty() found a repo")
@ -77,11 +79,17 @@ func createReleaseBox(box *gui.Node) {
}
me.Enable()
})
/*
release.grid.NewButton("nil", func() {
log.Info("just filling the grid")
release.grid.NewButton("Check Ready", func() {
goSumS := release.current.getGoSumStatus()
dirtyS := release.current.dirtyLabel.String()
lastS := release.current.status.GetLastTagVersion()
if CheckReady() {
log.Info("repo is ready", release.current.String(), goSumS, dirtyS, lastS)
return
} else {
log.Info("\trepo is not ready", release.current.String(), goSumS, dirtyS, lastS)
}
})
*/
release.grid.NewButton("next repo", func() {
buttonDisable()
defer buttonEnable()
@ -173,10 +181,10 @@ func createReleaseBox(box *gui.Node) {
release.notes = gadgets.NewOneLiner(release.grid, "notes")
release.version = gadgets.NewOneLiner(release.grid, "version")
release.version.SetText(versionS)
release.version.SetText(release.versionS)
release.reason = gadgets.NewBasicEntry(release.grid, "release reason")
release.reason.SetText(reasonS)
release.reason.SetText(release.reasonS)
release.sendVersionB = release.grid.NewButton("send version", func() {
log.Info("set version()")

View File

@ -20,8 +20,8 @@ type autoType struct {
myGui *gui.Node
// autotypistWindow *gadgets.BasicWindow
mainWindow *gui.Node
mainBox *gui.Node
mainWindow *gui.Node
mainBox *gui.Node
// #### autotypist Global Display Options
autoHidePerfect *gui.Node