Skip to content

Commit

Permalink
refactor exit code logic to switch case
Browse files Browse the repository at this point in the history
  • Loading branch information
xiantang committed Oct 23, 2023
1 parent 6554a4a commit 278965f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions runner/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,13 @@ func (e *Engine) runBin() error {
_, _ = io.Copy(os.Stderr, stderr)
state, _ := cmd.Process.Wait()
close(processExit)
if state.ExitCode() == 0 {
switch state.ExitCode() {
case 0:
e.runnerLog("Process Exit with Code 0")
} else {
e.runnerLog("Process Exit with an error: %v", state.ExitCode())
case -1:
// because when we use ctrl + c to stop will return -1
default:
e.runnerLog("Process Exit with Code: %v", state.ExitCode())
}

if !e.config.Build.Rerun {
Expand Down

0 comments on commit 278965f

Please sign in to comment.