summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go34
1 files changed, 14 insertions, 20 deletions
diff --git a/main.go b/main.go
index f8450b7..2750ec7 100644
--- a/main.go
+++ b/main.go
@@ -2,11 +2,8 @@ package main
import (
"embed"
- "os/user"
- "strings"
"go.wit.com/lib/debugger"
- "go.wit.com/lib/gui/repostatus"
"go.wit.com/log"
"go.wit.com/gui"
@@ -42,29 +39,26 @@ func main() {
me.repos = makeRepoView()
- usr, _ := user.Current()
- if args.OnlyMe {
- log.Info("not scanning everything")
- } else {
- log.Info("scanning everything in ~/go/src")
- for i, path := range repostatus.ListGitDirectories() {
- // log.Info("addRepo()", i, path)
- path = strings.TrimPrefix(path, me.goSrcPwd.String())
- path = strings.Trim(path, "/")
- log.Info("addRepo()", i, path)
- me.repos.View.AddRepo(path, "master", "devel", usr.Username)
- }
- }
+ // 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()
// process everything on the command line
+ // may exit here
handleCmdLine()
- me.repos.View.ScanRepositories()
- me.Enable()
-
// processing is done. update the repo summary box
me.summary.Update()
+ me.Enable()
+
// intermittently scans the status indefinitly
- me.repos.View.Watchdog()
+ me.repos.View.Watchdog(func() {
+ log.Info("In main()")
+ // processing is done. update the repo summary box
+ me.summary.Update()
+ })
}