diff --git a/main.go b/main.go index c82e3c6..0d91fd4 100644 --- a/main.go +++ b/main.go @@ -193,4 +193,8 @@ func main() { if err != nil { log.Fatalln(err) } + + if somethingFailed { + os.Exit(1) + } } diff --git a/pew.go b/pew.go index 3ec94c2..e8ac172 100644 --- a/pew.go +++ b/pew.go @@ -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))) }