diff options
| author | Jeff Carr <[email protected]> | 2025-10-22 11:08:59 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-22 11:08:59 -0500 |
| commit | e8a7433c9588827b275cbcf7a8745f886dd59ad4 (patch) | |
| tree | 727fc242f5d5da8ea36a50a09af9324ad903aa9d /main.go | |
| parent | de85934267a150290d4ffff052027a3363f3ce10 (diff) | |
adapt to the new lib/config and lib/ENVv0.0.65
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -9,6 +9,7 @@ import ( "path/filepath" "time" + "go.wit.com/lib/ENV" "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" @@ -21,7 +22,7 @@ var resources embed.FS var HOSTNAME string = "forge.wit.com" func saveMissing() error { - err := me.missing.SaveValidate(filepath.Join(me.forge.Config.ReposDir, "missing.pb")) + err := me.missing.SaveValidate(filepath.Join(ENV.Get("ReposDir"), "missing.pb")) if err != nil { log.Info("failed to save missing.pb", err) } @@ -32,8 +33,12 @@ func main() { me = new(mainType) me.argv = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args - me.forge = forgepb.InitByFullpath("/etc/forged/forge.text") - me.forge.Config.DumpENV() + var err error + me.forge, err = forgepb.InitByFullpath("/etc/forged/forge.text") + if err != nil { + panic("forge.InitByFullPath() failed") + } + ENV.PrintTable() if err := me.forge.InitPatchsets(); err != nil { log.Info("patches failed to open", err) @@ -48,7 +53,7 @@ func main() { } me.missing = gitpb.NewRepos() - err := me.missing.ConfigLoad(filepath.Join(me.forge.Config.ReposDir, "missing.pb")) + err = me.missing.ConfigLoad(filepath.Join(ENV.Get("ReposDir"), "missing.pb")) if errors.Is(err, os.ErrNotExist) { saveMissing() } else if err != nil { |
