diff options
Diffstat (limited to 'releaseBox.go')
| -rw-r--r-- | releaseBox.go | 56 |
1 files changed, 7 insertions, 49 deletions
diff --git a/releaseBox.go b/releaseBox.go index b73f7e4..67ac284 100644 --- a/releaseBox.go +++ b/releaseBox.go @@ -4,7 +4,6 @@ package main import ( "fmt" "os" - "strings" "time" "go.wit.com/gui" @@ -71,7 +70,9 @@ func createReleaseBox(box *gui.Node) { me.release.repo = gadgets.NewOneLiner(me.release.grid, "repo") me.release.openrepo = me.release.grid.NewButton("Configure", func() { - me.current.Status.Toggle() + if repov := me.repos.View.FindByPath(me.current.GetGoPath()); repov != nil { + repov.Status.Toggle() + } }) me.release.openrepo.Disable() me.release.grid.NextRow() @@ -104,8 +105,10 @@ func createReleaseBox(box *gui.Node) { grid.NewButton("whitelist", func() { // tmp := me.current.GoState() - log.Info("trying to whitelist repo", me.current.GetGoPath()) - me.current.Status.Whitelist = true + if repov := me.repos.View.FindByPath(me.current.GetGoPath()); repov != nil { + log.Info("trying to whitelist repo", me.current.GetGoPath()) + repov.Status.Whitelist = true + } findNext() }) @@ -191,51 +194,6 @@ func createReleaseBox(box *gui.Node) { } }) grid.NextRow() - - grid.NewButton("git ls-files |grep go.mod", func() { - loop := me.repos.View.ReposSortByName() - for loop.Scan() { - repo := loop.Repo() - log.Info("repo:", repo.Name()) - if repo.Status.ReadOnly() { - continue - } - if repo.Status.Whitelist { - log.Warn("skipping whitelist", repo.GetGoPath()) - continue - } - good, files := repo.Status.GitLsFiles() - if !good { - log.Warn("Something went wrong", repo.GetGoPath()) - continue - } - for _, filename := range strings.Split(files, "\n") { - log.Info("\tfile", filename) - if filename == "go.mod" { - log.Info("Found go.mod. does version match release version?") - log.Info(repo.Status.GetLastTagVersion(), "vs", repo.Status.GetTargetVersion()) - if repo.Status.GetLastTagVersion() != repo.Status.GetTargetVersion() { - log.Info(repo.Status.GetLastTagVersion(), "vs", repo.Status.GetTargetVersion()) - log.Info("Found go.sum. version mismatch") - setCurrentRepo(repo, "VERY BROKEN", "rewind go.mod commit") - return - } - } - if filename == "go.sum" { - log.Info("Found go.sum. does version match release version?") - log.Info(repo.Status.GetLastTagVersion(), "vs", repo.Status.GetTargetVersion()) - if repo.Status.GetLastTagVersion() != repo.Status.GetTargetVersion() { - log.Info(repo.Status.GetLastTagVersion(), "vs", repo.Status.GetTargetVersion()) - log.Info("Found go.sum. version mismatch") - setCurrentRepo(repo, "VERY BROKEN", "rewind go.mod commit") - return - } - } - } - } - log.Info("All repos seem okay") - }) - grid.NextRow() } func doReleaseAll() (bool, time.Duration) { |
