Display exit code when nonzero.
Brew fails if a tool (make, or whatever) doesn't return an exit code of 0. This patch displays the non-zero code on failure, so we can better diagnose what caused the build to fail (or if we need to add that exit code as exception 'success code'.)
This commit is contained in:
parent
9f07e5d9fd
commit
c3169b5600
@ -184,6 +184,7 @@ protected
|
||||
end
|
||||
end
|
||||
unless $? == 0
|
||||
puts "Exit code: #{$?}"
|
||||
puts out
|
||||
raise
|
||||
end
|
||||
|
||||
@ -69,7 +69,10 @@ def safe_system cmd, *args
|
||||
# CTRL-C interrupt to us too, so execution continues, but the exit code os
|
||||
# still 2 so we raise our own interrupt
|
||||
raise Interrupt, cmd if $?.termsig == 2
|
||||
raise ExecutionError.new(cmd, args) unless exec_success and $?.success?
|
||||
unless exec_success and $?.success?
|
||||
puts "Exit code: #{$?}"
|
||||
raise ExecutionError.new(cmd, args)
|
||||
end
|
||||
end
|
||||
|
||||
def curl url, *args
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user