common forge.Init()

This commit is contained in:
Jeff Carr 2025-09-11 04:46:47 -05:00
parent 15d545f389
commit 74313bd867
1 changed files with 14 additions and 0 deletions

14
init.go
View File

@ -35,6 +35,20 @@ func Init() *Forge {
log.Info("forge.Init() ok len(repos) =", f.Repos.Len()) log.Info("forge.Init() ok len(repos) =", f.Repos.Len())
return f return f
} }
func InitByAppname(argname string) *Forge {
cfg := new(ForgeConfigs)
err := config.ConfigLoad(cfg, argname, "forge")
if err != nil {
log.Info("forge has not been configured yet")
log.Info("go install go.wit.com/apps/forge@latest")
os.Exit(-1)
}
f := initFromConfig(cfg)
log.Info("forge.Init() ok len(repos) =", f.Repos.Len())
return f
}
func (f *Forge) InitScan() { func (f *Forge) InitScan() {
if f.hasFullScan { if f.hasFullScan {
// duplicate time checking below. which one to keep? // duplicate time checking below. which one to keep?