summaryrefslogtreecommitdiff
path: root/globalDisplayOptions.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-02 05:13:17 -0600
committerJeff Carr <[email protected]>2024-12-02 05:13:17 -0600
commitcfb4fb61bfab6e6816c0080b47d6a6d4b935cea2 (patch)
tree91be3748e0fb1c09cd0fa169d78ef65fc657fcb8 /globalDisplayOptions.go
parent02f7ee387ff083d5c39b3d99ec9defe3e66e3700 (diff)
more rewriting of old code
Diffstat (limited to 'globalDisplayOptions.go')
-rw-r--r--globalDisplayOptions.go92
1 files changed, 48 insertions, 44 deletions
diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go
index 3521e26..ed26177 100644
--- a/globalDisplayOptions.go
+++ b/globalDisplayOptions.go
@@ -30,50 +30,7 @@ func globalDisplayOptions(box *gui.Node) {
grid := group1.RawGrid()
grid.NewButton("make prepare-release", func() {
- me.Disable()
- me.release.box.Disable()
- defer me.Enable()
- loop := me.repos.View.ReposSortByName()
- for loop.Scan() {
- repo := loop.Repo()
- // check if the package dependancies changed, if so, re-publish
- check := me.forge.Repos.FindByGoPath(repo.GoPath())
- if check == nil {
- log.Info("boo, you didn't git clone", repo.GoPath())
- os.Exit(-1)
- }
- match, err := me.forge.Repos.GoDepsChanged(check)
- if err != nil {
- log.Info("dependancy checks failed", check.GetGoPath(), err)
- repo.Status.IncrementRevisionVersion("missing prior published godeps")
- continue
- }
- if match {
- log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath())
- repo.Status.IncrementRevisionVersion("godeps changed")
- continue
- } else {
- log.Printf("dependancies have not changed for %s\n", check.GetGoPath())
- }
-
- // see if there is a new version
- master := repo.Status.GetMasterVersion()
- lastTag := repo.Status.LastTag()
- if master == lastTag {
- repo.Status.SetTargetVersion(master)
- } else {
- repo.Status.IncrementRevisionVersion("Nov 2024 test")
- }
- }
- findNext()
- if setAllBranchesToMaster() {
- // if it succeeds, disable this button
- me.setBranchesToMasterB.Disable()
- me.release.box.Enable()
- me.repos.View.PrintReleaseReport("", "")
- } else {
- log.Info("setAllBranchesToMaster() failed")
- }
+ makePrepareRelease()
})
grid.NextRow()
@@ -86,3 +43,50 @@ func globalDisplayOptions(box *gui.Node) {
debugger.DebugWindow()
})
}
+
+func makePrepareRelease() {
+ me.Disable()
+ me.release.box.Disable()
+ defer me.Enable()
+ loop := me.repos.View.ReposSortByName()
+ for loop.Scan() {
+ repo := loop.Repo()
+ // check if the package dependancies changed, if so, re-publish
+ check := me.forge.Repos.FindByGoPath(repo.GoPath())
+ if check == nil {
+ log.Info("boo, you didn't git clone", repo.GoPath())
+ os.Exit(-1)
+ }
+ match, err := me.forge.Repos.GoDepsChanged(check)
+ if err != nil {
+ log.Info("dependancy checks failed", check.GetGoPath(), err)
+ repo.Status.IncrementRevisionVersion("missing prior published godeps")
+ continue
+ }
+ if match {
+ log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath())
+ repo.Status.IncrementRevisionVersion("godeps changed")
+ continue
+ } else {
+ log.Printf("dependancies have not changed for %s\n", check.GetGoPath())
+ }
+
+ // see if there is a new version
+ master := repo.Status.GetMasterVersion()
+ lastTag := repo.Status.LastTag()
+ if master == lastTag {
+ repo.Status.SetTargetVersion(master)
+ } else {
+ repo.Status.IncrementRevisionVersion("Nov 2024 test")
+ }
+ }
+ findNext()
+ if setAllBranchesToMaster() {
+ // if it succeeds, disable this button
+ me.setBranchesToMasterB.Disable()
+ me.release.box.Enable()
+ me.repos.View.PrintReleaseReport("", "")
+ } else {
+ log.Info("setAllBranchesToMaster() failed")
+ }
+}