aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorMax Howell2009-11-06 17:06:12 +0000
committerMax Howell2009-11-07 18:22:36 +0000
commit1e879eaee8815eebd3bc3f5318f62d1e86b4d62a (patch)
tree2ef5b9b6507c4d763c425c5e125bd337a2d0283b /Library/Homebrew/utils.rb
parent0ec10c68ca93c86c61463349e455cd4179b64e16 (diff)
downloadbrew-1e879eaee8815eebd3bc3f5318f62d1e86b4d62a.tar.bz2
Propagate exit status in ExecutioError exception
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 398119945..0f94cce6e 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -86,13 +86,10 @@ def safe_system cmd, *args
puts "#{cmd} #{args*' '}" if ARGV.verbose?
exec_success = Kernel.system cmd, *args
# some tools, eg. tar seem to confuse ruby and it doesn't propogate the
- # CTRL-C interrupt to us too, so execution continues, but the exit code os
+ # CTRL-C interrupt to us too, so execution continues, but the exit code is
# still 2 so we raise our own interrupt
raise Interrupt, cmd if $?.termsig == 2
- unless exec_success
- puts "Exit code: #{$?}"
- raise ExecutionError.new(cmd, args)
- end
+ raise ExecutionError.new(cmd, args, $?) unless exec_success
end
def curl *args
@@ -146,7 +143,6 @@ def arch_for_command cmd
return archs
end
-
# replaces before with after for the file path
def inreplace path, before, after
f = File.open(path, 'r')