diff options
| author | Jeff Carr <[email protected]> | 2024-12-05 12:37:07 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-05 12:37:07 -0600 |
| commit | 34a287a38e3af080ec3d3c42bbca5ef06b2311f8 (patch) | |
| tree | fa600ee6f6ee77bddd1f4f86c5f8b7276e066fe0 /init.go | |
| parent | f98179971e574de202c582576e59a8e3da68530f (diff) | |
Diffstat (limited to 'init.go')
| -rw-r--r-- | init.go | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -2,6 +2,7 @@ package forgepb import ( "os" + "path/filepath" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/lib/protobuf/zoopb" @@ -23,6 +24,13 @@ func Init() *Forge { } f.goSrc = os.Getenv("FORGE_GOSRC") + // also rethink this, but maybe this is the right thing to do + if os.Getenv("FORGE_CONFIG") == "" { + homeDir, _ := os.UserHomeDir() + fullpath := filepath.Join(homeDir, ".config/forge") + os.Setenv("FORGE_CONFIG", fullpath) + } + // cache.go has Do() // f.initOnce.Do(f.initWork) @@ -42,10 +50,11 @@ func Init() *Forge { log.Warn("zoopb.ConfigLoad() failed", err) os.Exit(-1) } - f.Machine.InitWit() + // f.Machine.InitWit() - log.Info("forge pre scan ", f.Repos.Len(), "repos in", f.goSrc) + start := f.Repos.Len() f.ScanGoSrc() - log.Info("forge.Init() found", f.Repos.Len(), "repos in", f.goSrc) + end := f.Repos.Len() + log.Info("forge.ScanGoSrc() Found", end-start, "new repos in", f.goSrc) return f } |
