mirror of
https://github.com/maaslalani/slides.git
synced 2026-01-10 06:48:01 -05:00
Use exit code from command if exists
This commit is contained in:
@@ -126,7 +126,11 @@ func Execute(code Block) Result {
|
||||
|
||||
// update status code
|
||||
if err != nil {
|
||||
exitCode = 1
|
||||
if cmd.ProcessState != nil {
|
||||
exitCode = cmd.ProcessState.ExitCode()
|
||||
} else {
|
||||
exitCode = 1 // non-zero
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ func main() {
|
||||
},
|
||||
expected: code.Result{
|
||||
Out: "exit status 127",
|
||||
ExitCode: 1,
|
||||
ExitCode: 127,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user