summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go50
1 files changed, 11 insertions, 39 deletions
diff --git a/main.go b/main.go
index cb3b4a8..3db4737 100644
--- a/main.go
+++ b/main.go
@@ -4,11 +4,9 @@ package main
import (
"strings"
- "time"
"go.wit.com/dev/alexflint/arg"
"go.wit.com/gui"
- "go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
@@ -40,11 +38,6 @@ func main() {
me.forge = forgepb.Init()
me.found = new(gitpb.Repos)
- if configSave {
- me.forge.ConfigSave()
- configSave = false
- }
-
if argv.User {
me.forge.CheckoutUser()
okExit("")
@@ -69,38 +62,6 @@ func main() {
okExit("")
}
- if argv.Dirty {
- now := time.Now()
- all := me.forge.Repos.SortByFullPath()
- for all.Scan() {
- repo := all.Next()
- dirty := repo.IsDirty()
- if repo.CheckDirty() {
- me.found.AppendUniqueGoPath(repo)
- if !dirty {
- configSave = true
- }
- } else {
- if dirty {
- configSave = true
- }
- }
- }
- doCobol()
- log.Info("dirty check took:", shell.FormatDuration(time.Since(now)))
- me.forge.SetConfigSave(configSave)
- okExit("")
- }
-
- /*
- // var count int
- all := me.forge.Repos.SortByFullPath()
- for all.Scan() {
- repo := all.Next()
- verifyPrint(repo)
- }
- */
-
if argv.Fix {
okExit("")
}
@@ -121,6 +82,12 @@ func main() {
// now, do something to all of them (or just print out a table of them)
var done bool = false
if argv.Do != nil {
+ if argv.Do.Dirty {
+ doCheckDirty()
+ okExit("")
+ done = true
+ }
+
if argv.Do.Scan {
doScan()
done = true
@@ -154,6 +121,11 @@ func main() {
okExit("patches")
}
+ if configSave {
+ me.forge.ConfigSave()
+ configSave = false
+ }
+
// if the user doesn't want to open the GUI and
// nothing else was specified to be done,
// then just list the table to stdout