diff options
| author | Jeff Carr <[email protected]> | 2025-09-11 03:36:47 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-11 03:36:47 -0500 |
| commit | b984a53aac6b90e69d9d8dbf04ca12cce2cc498f (patch) | |
| tree | 5834535b20342dc7e2868a0dbb0a722a2fa5f3cd | |
| parent | c8d67da4cc92d707db4d9d78920f40755fadae71 (diff) | |
new init() and config()
| -rw-r--r-- | config.go | 19 | ||||
| -rw-r--r-- | main.go | 5 |
2 files changed, 22 insertions, 2 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 +} @@ -41,8 +41,9 @@ func main() { state = make(map[*gitpb.Repo]string) debnames = make(map[*gitpb.Repo]string) - // load the ~/.config/forge/ config - me.forge = forgepb.Init() + // read in forge info + cfg := configInit() + me.forge = forgepb.InitFromConfig(cfg) me.machine = new(zoopb.Machine) if err := me.machine.ConfigLoad(); err != nil { |
