common forge.Init()
This commit is contained in:
parent
15d545f389
commit
74313bd867
14
init.go
14
init.go
|
@ -35,6 +35,20 @@ func Init() *Forge {
|
|||
log.Info("forge.Init() ok len(repos) =", f.Repos.Len())
|
||||
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() {
|
||||
if f.hasFullScan {
|
||||
// duplicate time checking below. which one to keep?
|
||||
|
|
Loading…
Reference in New Issue