fixes for new autogenpb

This commit is contained in:
Jeff Carr 2025-01-12 20:05:46 -06:00
parent 0600f54488
commit 23887a155e
1 changed files with 11 additions and 2 deletions

13
init.go
View File

@ -50,8 +50,7 @@ func Init() *Forge {
return f
}
// only init's the protobuf. intended to not scan or change anything
func InitPB() *Forge {
func DetermineGoPath() *Forge {
f := new(Forge)
// TODO: rethink this but it works for now
@ -80,6 +79,10 @@ func InitPB() *Forge {
// print out the settings that will be used
log.Log(INFO, "forgepb.Init() FORGE_CONFIG", os.Getenv("FORGE_CONFIG"))
return f
}
func (f *Forge) InitPB() {
// load the ~/.config/forge/ config
f.Config = new(ForgeConfigs)
if err := f.Config.ConfigLoad(); err != nil {
@ -93,6 +96,12 @@ func InitPB() *Forge {
}
f.Repos = new(gitpb.Repos)
f.Repos.ConfigLoad()
}
// only init's the protobuf. intended to not scan or change anything
func InitPB() *Forge {
f := DetermineGoPath()
f.InitPB()
return f
}