back to a common Init()
This commit is contained in:
parent
ad1144efe5
commit
7cf1758a36
19
config.go
19
config.go
|
@ -1,19 +0,0 @@
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.wit.com/lib/config"
|
|
||||||
"go.wit.com/lib/protobuf/forgepb"
|
|
||||||
"go.wit.com/log"
|
|
||||||
)
|
|
||||||
|
|
||||||
// sent via -ldflags
|
|
||||||
|
|
||||||
func configInit() *forgepb.ForgeConfigs {
|
|
||||||
configs := new(forgepb.ForgeConfigs)
|
|
||||||
err := config.ConfigLoad(configs, "forge", "forge")
|
|
||||||
if err != nil {
|
|
||||||
log.Info("This tool requires your repos be scanned by forge first")
|
|
||||||
badExit(err)
|
|
||||||
}
|
|
||||||
return configs
|
|
||||||
}
|
|
5
main.go
5
main.go
|
@ -31,10 +31,7 @@ func main() {
|
||||||
me.myGui = prep.Gui() // prepares the GUI package for go-args
|
me.myGui = prep.Gui() // prepares the GUI package for go-args
|
||||||
me.pp = arg.MustParse(&argv)
|
me.pp = arg.MustParse(&argv)
|
||||||
|
|
||||||
// read in forge info
|
me.forge = forgepb.Init()
|
||||||
cfg := configInit()
|
|
||||||
me.forge = forgepb.InitFromConfig(cfg)
|
|
||||||
|
|
||||||
me.found = new(gitpb.Repos)
|
me.found = new(gitpb.Repos)
|
||||||
|
|
||||||
fhelp.CheckGoModCleanExit()
|
fhelp.CheckGoModCleanExit()
|
||||||
|
|
Loading…
Reference in New Issue