new init() and config()
This commit is contained in:
parent
c8d67da4cc
commit
b984a53aac
|
@ -0,0 +1,19 @@
|
|||
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
|
@ -41,8 +41,9 @@ func main() {
|
|||
state = make(map[*gitpb.Repo]string)
|
||||
debnames = make(map[*gitpb.Repo]string)
|
||||
|
||||
// load the ~/.config/forge/ config
|
||||
me.forge = forgepb.Init()
|
||||
// read in forge info
|
||||
cfg := configInit()
|
||||
me.forge = forgepb.InitFromConfig(cfg)
|
||||
|
||||
me.machine = new(zoopb.Machine)
|
||||
if err := me.machine.ConfigLoad(); err != nil {
|
||||
|
|
Loading…
Reference in New Issue