summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.go9
-rw-r--r--main.go6
-rw-r--r--releaseBox.go7
3 files changed, 14 insertions, 8 deletions
diff --git a/config.go b/config.go
index 3a98777..24f047a 100644
--- a/config.go
+++ b/config.go
@@ -3,12 +3,17 @@ package main
import (
"go.wit.com/lib/config"
"go.wit.com/lib/protobuf/forgepb"
+ "go.wit.com/log"
)
// sent via -ldflags
-func configInit() (*forgepb.ForgeConfigs, error) {
+func configInit() *forgepb.ForgeConfigs {
configs := new(forgepb.ForgeConfigs)
err := config.ConfigLoad(configs, "forge", "forge")
- return configs, err
+ if err != nil {
+ log.Info("This tool requires your repos be scanned by forge first")
+ badExit(err)
+ }
+ return configs
}
diff --git a/main.go b/main.go
index c140b97..879819b 100644
--- a/main.go
+++ b/main.go
@@ -31,8 +31,10 @@ func main() {
me.myGui = prep.Gui() // prepares the GUI package for go-args
me.pp = arg.MustParse(&argv)
- // load the ~/.config/forge/ config
- me.forge = forgepb.Init()
+ // read in forge info
+ cfg := configInit()
+ me.forge = forgepb.InitFromConfig(cfg)
+
me.found = new(gitpb.Repos)
fhelp.CheckGoModCleanExit()
diff --git a/releaseBox.go b/releaseBox.go
index 8a5e1cc..e47b0f3 100644
--- a/releaseBox.go
+++ b/releaseBox.go
@@ -11,7 +11,6 @@ import (
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/repolist"
"go.wit.com/lib/gui/shell"
- "go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
)
@@ -156,9 +155,9 @@ func doReleaseAll() {
func skipToNext() error {
shell.RunVerbose([]string{"forge", "dirty"})
- log.Info("Sleeping for 10 seconds. Forge file should have been rewritten")
- time.Sleep(10)
- me.forge = forgepb.Init()
+ log.Info("Sleeping for 3 seconds. Forge file should have been rewritten")
+ time.Sleep(3)
+ me.forge.InitScan()
me.found = new(gitpb.Repos)
me.current.Reload()