back to a common Init()
This commit is contained in:
parent
c638819b00
commit
96ea435179
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
|
|
||||||
}
|
|
4
main.go
4
main.go
|
@ -42,9 +42,7 @@ func main() {
|
||||||
gitMap = make(map[string]*gitpb.Repo)
|
gitMap = make(map[string]*gitpb.Repo)
|
||||||
repoMap = make(map[string]string)
|
repoMap = make(map[string]string)
|
||||||
|
|
||||||
// read in forge info
|
forge = forgepb.Init()
|
||||||
cfg := configInit()
|
|
||||||
forge = forgepb.InitFromConfig(cfg)
|
|
||||||
|
|
||||||
// parse the repomap file
|
// parse the repomap file
|
||||||
readRepomap()
|
readRepomap()
|
||||||
|
|
Loading…
Reference in New Issue