From e927975dc890216c7172f711222cfdf283c0dd1c Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 20 Feb 2024 14:44:38 -0600 Subject: reorg interface. it's almost working again --- main.go | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 3a7d1fe..5f0068a 100644 --- a/main.go +++ b/main.go @@ -45,9 +45,6 @@ func main() { me.mainWindow = me.myGui.NewWindow("GUI release manager") me.mainBox = me.mainWindow.NewBox("bw hbox", true) - // the left side of the window options - globalDisplayOptions(me.mainBox) - // sanity check of things that might be around that mess // up things later // if you have a go.work file, you must delete it @@ -73,13 +70,16 @@ func main() { log.Info("Creating the Release Window") - // scan in the repo map first - // hopefully this is the list of all the golang packages and only the GUI golang packages + // initialize the repo list window + // which should be all the git repositories in ~/go/src & the .config file me.repos = makeRepoView() // register a Show/Hide function for the repo list table me.repos.View.RegisterHideFunction(showHideRepos) + // the left side of the window options + globalDisplayOptions(me.mainBox) + // create the right side of the main window createReleaseBox(me.mainBox) @@ -91,6 +91,8 @@ func main() { // so I can't trust even what I see. It's complicated right now still. release.openrepo.Disable() + log.Sleep(5) + // parse config file and scan for .git repos me.repos.initRepoList() @@ -110,8 +112,15 @@ func main() { // start the initail scan and make sure each repo is set // to the master branch -func setBranchToMaster() { +func setAllBranchesToMaster() bool { + var worked bool = true for _, repo := range me.repos.View.AllRepos() { + if repo.ReadOnly() { + continue + } + if repo.IsDirty() { + continue + } if whitelist(repo.GoPath()) { continue } @@ -119,9 +128,11 @@ func setBranchToMaster() { log.Warn("git checkout master branch worked", repo.Name()) } else { log.Warn("git checkout master branch failed", repo.Name()) + worked = false } // repo.NewScan() } + return worked } func setTargetVersion() { -- cgit v1.2.3