diff options
| author | Jeff Carr <[email protected]> | 2025-09-11 03:36:31 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-11 03:36:31 -0500 | 
| commit | 8e67e31bbed9219d93e2f88aeec6040aaf10020f (patch) | |
| tree | 1215f4d060e5764f746de6dcb5dd12e07da1a4ea | |
| parent | b3dc0e265e9d03de5c33d53f152d0bb9baa2a4d1 (diff) | |
new init & config()
| -rw-r--r-- | config.go | 19 | ||||
| -rw-r--r-- | exit.go | 18 | ||||
| -rw-r--r-- | main.go | 5 | 
3 files changed, 41 insertions, 1 deletions
diff --git a/config.go b/config.go new file mode 100644 index 0000000..24f047a --- /dev/null +++ b/config.go @@ -0,0 +1,19 @@ +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 { +	configs := new(forgepb.ForgeConfigs) +	err := config.ConfigLoad(configs, "forge", "forge") +	if err != nil { +		log.Info("This tool requires your repos be scanned by forge first") +		badExit(err) +	} +	return configs +} @@ -0,0 +1,18 @@ +package main + +import ( +	"os" + +	"go.wit.com/log" +) + +func okExit(thing string) { +	log.Info(thing, "ok") +	// log.Info("Finished go-clean on", check.GetGoPath(), "ok") +	os.Exit(0) +} + +func badExit(err error) { +	log.Info("go-gui-toolkits failed: ", err) +	os.Exit(-1) +} @@ -7,7 +7,10 @@ import (  // go will sit here until the window exits  func main() { -	forge := forgepb.Init() +	// read in forge info +	cfg := configInit() +	forge := forgepb.InitFromConfig(cfg) +  	all := forge.Repos.SortByFullPath()  	for all.Scan() {  		check := all.Next()  | 
