summaryrefslogtreecommitdiff
path: root/releaseBox.go
diff options
context:
space:
mode:
Diffstat (limited to 'releaseBox.go')
-rw-r--r--releaseBox.go56
1 files changed, 7 insertions, 49 deletions
diff --git a/releaseBox.go b/releaseBox.go
index 7c1778c..6188f13 100644
--- a/releaseBox.go
+++ b/releaseBox.go
@@ -12,11 +12,10 @@ import (
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/repolist"
+ "go.wit.com/lib/gui/shell"
)
type releaseStruct struct {
- // current *repolist.Repo
-
box *gui.Node
group *gui.Node
grid *gui.Node
@@ -25,12 +24,8 @@ type releaseStruct struct {
readOnly *gadgets.OneLiner
notes *gadgets.OneLiner
version *gadgets.OneLiner
- // versionS string
- // widgetVersionS string
releaseVersionB *gui.Node
- // unreleaseB *gui.Node
reason *gadgets.BasicEntry
- // reasonS string
openrepo *gui.Node
@@ -58,7 +53,6 @@ func (w *autoType) Enable() {
func createReleaseBox(box *gui.Node) {
initWhitelist()
- // me.release.box = box
me.release.box = box.NewVerticalBox("vbox")
me.release.group = me.release.box.NewGroup("Current Repo")
me.release.grid = me.release.group.NewGrid("buildOptions", 0, 0)
@@ -120,7 +114,7 @@ func createReleaseBox(box *gui.Node) {
me.goSrcPwd.SetText(srcDir)
testf := filepath.Join(srcDir, "go.wit.com/apps/guireleaser", "go.sum")
- if !Exists(testf) {
+ if !shell.Exists(testf) {
log.Info("go.sum missing", testf)
panic("redo go.sum")
}
@@ -129,9 +123,9 @@ func createReleaseBox(box *gui.Node) {
grid := group.NewGrid("buildOptions", 0, 0)
grid.NewButton("set to IGNORE", func() {
- tmp := me.current.GoState()
- log.Info("trying to set repo IGNORE is now =", tmp)
- me.current.SetGoState("IGNORE")
+ // tmp := me.current.GoState()
+ log.Info("trying to whitelist repo", me.current.GoPath())
+ // me.current.SetGoState("IGNORE")
me.release.whitelist[me.current.GoPath()] = me.current
})
@@ -141,16 +135,6 @@ func createReleaseBox(box *gui.Node) {
buttonEnable()
})
- grid.NewButton("Check Ready", func() {
- buttonDisable()
- defer buttonEnable()
- if CheckReady() {
- log.Info("repo is ready", me.current.Name())
- return
- } else {
- log.Info("\trepo is not ready", me.current.Name())
- }
- })
grid.NextRow()
group = me.release.box.NewGroup("Process against all repos")
@@ -277,46 +261,20 @@ func setCurrentRepo(newcur *repolist.RepoRow, s string, note string) bool {
me.current = newcur
me.release.version.SetText(me.current.Status.GetTargetVersion())
me.release.releaseVersionB.SetText("release version " + me.current.Status.GetTargetVersion())
- // me.release.unreleaseB.SetText("un-release version " + me.current.targetVersion.String())
me.release.openrepo.Enable()
return true
}
-func scanForReady() bool {
- for _, repo := range me.repos.View.AllRepos() {
- goSumS := repo.GoState()
- dirtyS := repo.State()
- log.Info("findNext()", repo.GoPath(), goSumS, dirtyS)
-
- if whitelist(repo.GoPath()) {
- log.Info("found WHITELIST", repo.GoPath())
- repo.SetGoState("WHITELIST")
- continue
- }
-
- log.Info("scan for Ready: found a repo")
- if setCurrentRepo(repo, "checking ready", "notsure") {
- CheckReady()
- }
- }
- return true
-}
-
// trys to figure out if there is still something to update
// todo: redo this logic as it is terrible
// rename this findNext()
func findNext() bool {
for _, repo := range me.repos.View.AllRepos() {
- goSumS := repo.GoState()
-
if repo.Status.IsReleased() {
continue
}
- if goSumS == "WHITELIST" {
- continue
- }
- if goSumS == "IGNORE" {
+ if whitelist(repo.GoPath()) {
continue
}
if repo.ReadOnly() {
@@ -331,7 +289,7 @@ func findNext() bool {
// if ! repo.Status.Exists("go.sum") {
// }
if repo.Status.IsPrimitive() {
- log.Info("findNext()", repo.GoPath(), goSumS)
+ log.Info("findNext()", repo.GoPath())
if setCurrentRepo(repo, "PRIMATIVE", "release new version") {
return true
}