new forge.Init() process
This commit is contained in:
parent
1eeab58670
commit
a97eb38bc5
|
@ -0,0 +1,14 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"go.wit.com/lib/config"
|
||||
"go.wit.com/lib/protobuf/forgepb"
|
||||
)
|
||||
|
||||
// sent via -ldflags
|
||||
|
||||
func configInit() (*forgepb.ForgeConfigs, error) {
|
||||
configs := new(forgepb.ForgeConfigs)
|
||||
err := config.ConfigLoad(configs, "forge", "forge")
|
||||
return configs, err
|
||||
}
|
9
main.go
9
main.go
|
@ -37,9 +37,14 @@ func main() {
|
|||
}
|
||||
|
||||
log.Info("go-mod-clean version", VERSION, "built on", BUILDTIME)
|
||||
|
||||
// load the ~/.config/forge/ config
|
||||
// this lets you configure repos you have read/write access too
|
||||
forge = forgepb.InitPB() // todo: make this scan only if pb file not found
|
||||
cfg, err := configInit()
|
||||
if err != nil {
|
||||
log.Info("This tool requires your repos be scanned by forge first")
|
||||
badExit(nil, err)
|
||||
}
|
||||
forge = forgepb.InitFromConfig(cfg)
|
||||
|
||||
// figure out what directory we are running in
|
||||
check = findPwdRepo()
|
||||
|
|
Loading…
Reference in New Issue