diff --git a/exec.go b/exec.go index a8ad01d2e..08f0f0c27 100644 --- a/exec.go +++ b/exec.go @@ -123,14 +123,14 @@ func ExecCommand(app *kingpin.Application, input ExecCommandInput) { var waitStatus syscall.WaitStatus if err := cmd.Run(); err != nil { - if err != nil { - app.Errorf("%v", err) - return - } if exitError, ok := err.(*exec.ExitError); ok { waitStatus = exitError.Sys().(syscall.WaitStatus) os.Exit(waitStatus.ExitStatus()) } + if err != nil { + app.Errorf("%v", err) + return + } } }