remove os.Exit() as things are more stable now

This commit is contained in:
Jeff Carr 2024-12-14 16:29:39 -06:00
parent 5673e2cc2e
commit b55548a58b
3 changed files with 1 additions and 8 deletions

View File

@ -7,7 +7,6 @@ import (
"errors"
"os"
"path/filepath"
"time"
"go.wit.com/log"
)
@ -120,9 +119,6 @@ func (c *ForgeConfigs) ConfigLoad() error {
if _, err := os.Stat(cpath); err == nil {
log.Info("Something has gone wrong. Your", os.Getenv("FORGE_CONFIG"), "directory exists")
log.Info("However, the config files could not be loaded")
time.Sleep(2 * time.Second)
os.Exit(-1)
// return errors.New("config files can not be loaded from" + os.Getenv("FORGE_CONFIG"))
}
// first time user. make a template config file

View File

@ -37,7 +37,7 @@ func (f *Forge) ScanGoSrc() (bool, error) {
newcount, err := f.rillScanDirs(gopaths)
if err != nil {
log.Info("go src dir problem. exit for now?", err)
os.Exit(-1)
return false, err
}
if newcount != 0 {
log.Info("forge go src scan found", newcount, "repos")

View File

@ -28,7 +28,6 @@ func Init() *Forge {
if err := f.Machine.ConfigLoad(); err != nil {
log.Warn("zoopb.ConfigLoad() failed", err)
os.Exit(-1)
}
f.Machine.InitWit()
return f
@ -44,7 +43,6 @@ func InitPB() *Forge {
goSrcDir, err := f.findGoSrc()
if err != nil {
log.Warn("forge init() findGoSrc()", err)
os.Exit(-1)
}
os.Setenv("FORGE_GOSRC", goSrcDir)
}
@ -69,7 +67,6 @@ func InitPB() *Forge {
f.Config = new(ForgeConfigs)
if err := f.Config.ConfigLoad(); err != nil {
log.Warn("forgepb.ConfigLoad() failed", err)
os.Exit(-1)
}
if f.IsGoWork() {