aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorMax Howell2009-11-11 19:42:35 +0000
committerMax Howell2009-11-11 19:42:35 +0000
commitcf04a0b4463cb48be1c69de2fd20e64c3fe14eee (patch)
treefc47b9c53ae9a204a1de58d76b6b86c576cd2f3a /Library/Homebrew/utils.rb
parentab7697f528071f7e150383ffa20476f5082fd912 (diff)
downloadhomebrew-cf04a0b4463cb48be1c69de2fd20e64c3fe14eee.tar.bz2
Fix system() exception showing regression
Rather than showing a backtrace that says "couldn't find command blah". Admittedly it's possible that the error will be something else, but unlikely. And this is neater. Ideally we'd push the bt through an error pipe like we do with install.rb. And I guess we'll do this eventually.
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index a96d0e2ae..8ec87b508 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -88,8 +88,8 @@ end
def safe_system cmd, *args
puts "#{cmd} #{args*' '}" if ARGV.verbose?
fork do
- trap("EXIT") {} # no bt on exit from this short-lived fork
- exit! 1 unless exec(cmd, *args)
+ exec(cmd, *args) rescue nil
+ exit! 1 # never gets here unless exec failed
end
Process.wait
raise ExecutionError.new(cmd, args, $?) unless $?.success?