1
0

Non-zero exit status if something failed

This commit is contained in:
dump_stack() 2018-12-07 03:14:10 +00:00
parent 4dd34fec1d
commit 2a3c3ed18e
2 changed files with 7 additions and 0 deletions

View File

@ -193,4 +193,8 @@ func main() {
if err != nil {
log.Fatalln(err)
}
if somethingFailed {
os.Exit(1)
}
}

3
pew.go
View File

@ -24,6 +24,8 @@ import (
qemu "github.com/jollheef/out-of-tree/qemu"
)
var somethingFailed = false
func dockerCommand(container, workdir, timeout, command string) *exec.Cmd {
return exec.Command("timeout", "-k", timeout, timeout, "docker", "run",
"-v", workdir+":/work", container,
@ -116,6 +118,7 @@ func genOkFail(name string, ok bool) aurora.Value {
s := " " + name + " SUCCESS "
return aurora.BgGreen(aurora.Black(s))
} else {
somethingFailed = true
s := " " + name + " FAILURE "
return aurora.BgRed(aurora.Gray(aurora.Bold(s)))
}