summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go102
1 files changed, 51 insertions, 51 deletions
diff --git a/main.go b/main.go
index f1d6d98..3c98bb3 100644
--- a/main.go
+++ b/main.go
@@ -66,8 +66,58 @@ func main() {
// save the ENV var here
me.releaseReasonS = releaseReasonS
+ 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
me.repos = makeRepoView()
+ log.Sleep(3)
+
+ // create the right side of the main window
+ createReleaseBox(me.mainBox)
+
+ // disable the open repo button. this isn't really important
+ // but does indicates the app (and toolkit) is working
+ // this can be removed later, but in these early days, I'm using this
+ // tool to release the code for this app, the gui and the gui toolkits
+ // and sometimes they lie, don't display stuff, don't even disable things
+ // so I can't trust even what I see. It's complicated right now still.
+ release.openrepo.Disable()
+
+ // parse config file and scan for .git repos
+ me.repos.initRepoList()
+
+ // reads in the State of all the repos
+ // TODO: should not really be necessary directly after init()
+ me.repos.View.ScanRepositories()
+ me.Enable()
+
+ // intermittently scans the status indefinitly
+ me.repos.View.Watchdog(func() {
+ log.Info("In main()")
+ // processing is done. update the repo summary box
+ // me.summary.Update()
+ })
+}
+
+func setRepoState() {
+ // start the initail scan and make sure each repo is set
+ // to the master branch
+ for _, repo := range me.repos.View.AllRepos() {
+ if repo.ReadOnly() {
+ continue
+ }
+ if whitelist(repo.GoPath()) {
+ continue
+ }
+ if repo.Status.CheckoutMaster() {
+ log.Warn("git checkout master branch worked", repo.Name())
+ } else {
+ log.Warn("git checkout master branch failed", repo.Name())
+ }
+ repo.NewScan()
+ }
// go through and set the target versions for each repo
// todo: add sanity checking in repolist to verify these and/or autocompute them
// for now, just don't be stupid when you set your ENV vars
@@ -98,57 +148,7 @@ func main() {
repo.Status.SetTargetVersion(lasttag)
}
}
- log.Info("Creating the Release Window")
-
- // create the right side of the main window
- createReleaseBox(me.mainBox)
-
-
- // start the initail scan and make sure each repo is set
- // to the master branch
for _, repo := range me.repos.View.AllRepos() {
- if repo.ReadOnly() {
- continue
- }
- if whitelist(repo.GoPath()) {
- continue
- }
- if repo.Status.CheckoutMaster() {
- log.Warn("git checkout master branch worked", repo.Name())
- repo.Status.UpdateNew()
- } else {
- repo.Status.UpdateNew()
- log.Warn("git checkout master branch failed", repo.Name())
- }
+ repo.NewScan()
}
-
- // disable the open repo button. this isn't really important
- // but does indicates the app (and toolkit) is working
- // this can be removed later, but in these early days, I'm using this
- // tool to release the code for this app, the gui and the gui toolkits
- // and sometimes they lie, don't display stuff, don't even disable things
- // so I can't trust even what I see. It's complicated right now still.
- release.openrepo.Disable()
-
- // I don't know what this is autotypist thing?
- // globalResetOptions(me.mainbox)
-
- // hopefully this is the list of all the golang packages and only the GUI golang packages
- me.repos = makeRepoView()
-
- // parse config file and scan for .git repos
- me.repos.initRepoList()
-
- // reads in the State of all the repos
- // TODO: should not really be necessary directly after init()
- me.repos.View.ScanRepositories()
-
- me.Enable()
-
- // intermittently scans the status indefinitly
- me.repos.View.Watchdog(func() {
- log.Info("In main()")
- // processing is done. update the repo summary box
- // me.summary.Update()
- })
}