From 8e9408bac890dd6a09ebb5a7fed752fa9a35a73e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 15 Dec 2024 17:03:51 -0600 Subject: don't os.exit anymore as often --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 4fce146..f205357 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,8 @@ package main import ( "embed" + "errors" + "fmt" "os" "path/filepath" "strings" @@ -35,8 +37,7 @@ func main() { me.releaseReasonS = os.Getenv("GUIRELEASE_REASON") if me.releaseReasonS == "" { - log.Info("shell ENV GUIRELEASE_REASON not set") - os.Exit(0) + badExit(errors.New("shell ENV GUIRELEASE_REASON not set")) } // unset the go development ENV var to generate release files @@ -62,8 +63,7 @@ func main() { homeDir, _ := os.UserHomeDir() gowork := filepath.Join(homeDir, "go/src/go.work") if shell.Exists(gowork) { - log.Info("go.work must be deleted") - os.Exit(0) + badExit(errors.New("go.work must be deleted")) } log.Info("Creating the Release Window") @@ -118,8 +118,8 @@ func main() { me.startRepo = me.forge.Repos.FindByGoPath(basedir) if me.startRepo == nil { - log.Info("Can not run if pwd is not a repo", basedir) - os.Exit(0) + msg := fmt.Sprint("Can not run if pwd is not a repo", basedir) + badExit(errors.New(msg)) } me.Enable() -- cgit v1.2.3