summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-05 12:37:07 -0600
committerJeff Carr <[email protected]>2024-12-05 12:37:07 -0600
commit34a287a38e3af080ec3d3c42bbca5ef06b2311f8 (patch)
treefa600ee6f6ee77bddd1f4f86c5f8b7276e066fe0 /init.go
parentf98179971e574de202c582576e59a8e3da68530f (diff)
work on config file savev0.0.24v0.0.23
Diffstat (limited to 'init.go')
-rw-r--r--init.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/init.go b/init.go
index 3986bc0..1d41d62 100644
--- a/init.go
+++ b/init.go
@@ -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
}