Skip to content

Commit

Permalink
Merge pull request #107 from hraban/exitcode
Browse files Browse the repository at this point in the history
exec: Exit with exit code of subcommand
  • Loading branch information
lox committed Dec 29, 2016
2 parents 658b48f + 0fadd92 commit 76df892
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

3 comments on commit 76df892

@tejasmanohar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind releasing these changes?

@mtibben
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tejasmanohar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.