cleaned up init.go more perfectly

This commit is contained in:
Jeff Carr 2025-09-04 19:17:58 -05:00
parent 4cac4386f5
commit 8202a75eea
2 changed files with 5 additions and 29 deletions

18
init.go
View File

@ -96,6 +96,9 @@ func (f *Forge) InitPB() {
f.hasFullScan = true f.hasFullScan = true
} }
// init the Patchsets
f.Patchsets = NewPatchsets()
// todo: play with these / determine good values based on user's machine // todo: play with these / determine good values based on user's machine
f.rillX = 10 f.rillX = 10
f.rillY = 20 f.rillY = 20
@ -139,20 +142,7 @@ func RawInitPB() *Forge {
} }
func (f *Forge) RawInitPB() { func (f *Forge) RawInitPB() {
f.setenv() f.InitPB()
// load the ~/.config/forge/ config
f.Config = new(ForgeConfigs)
if err := f.Config.ConfigLoad(f.configDir); err != nil {
log.Log(WARN, "forgepb.ConfigLoad() failed", err)
}
f.Repos = gitpb.NewRepos()
f.Repos.ConfigLoad()
// todo: play with these / determine good values based on user's machine
f.rillX = 10
f.rillY = 20
} }
// the first thing done is process any ENV settings // the first thing done is process any ENV settings

View File

@ -8,13 +8,6 @@ import (
// retrieves current patches from forge // retrieves current patches from forge
func (f *Forge) GetPatches() error { func (f *Forge) GetPatches() error {
/*
defer func() {
if r := recover(); r != nil {
log.Warn("PANIC ecovered in loadUpstream()", r)
}
}()
*/
url := f.forgeURL + "GetPatchsets" url := f.forgeURL + "GetPatchsets"
log.Info("GetPatchsets() url", url) log.Info("GetPatchsets() url", url)
body, err := f.HttpPost(url, nil) body, err := f.HttpPost(url, nil)
@ -36,15 +29,8 @@ func (f *Forge) GetPatches() error {
} }
func (f *Forge) loadUpstreamPatchsets(psets *Patchsets) { func (f *Forge) loadUpstreamPatchsets(psets *Patchsets) {
/*
defer func() {
if r := recover(); r != nil {
log.Warn("PANIC ecovered in loadUpstream()", r)
}
}()
*/
var foundnew bool var foundnew bool
all := psets.All() all := psets.All()
for all.Scan() { for all.Scan() {
pset := all.Next() pset := all.Next()