aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils
diff options
context:
space:
mode:
authorMike McQuaid2017-12-03 09:23:01 +0000
committerGitHub2017-12-03 09:23:01 +0000
commit0d53831b902e2c9df5e6540822d1a8fd4672577d (patch)
treef3cfadc93d7b6ca0e24877cc4e23cf3f93235120 /Library/Homebrew/utils
parentd0e893fab69957b7ab170cfcc2db6a8f95e3ebac (diff)
parent7adee6d62fabae0244d611069f09ab906a459805 (diff)
downloadbrew-0d53831b902e2c9df5e6540822d1a8fd4672577d.tar.bz2
Merge pull request #3515 from sjackman/popen
Utils.popen_read: Nonexistent program should fail
Diffstat (limited to 'Library/Homebrew/utils')
-rw-r--r--Library/Homebrew/utils/popen.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/Library/Homebrew/utils/popen.rb b/Library/Homebrew/utils/popen.rb
index 2fa3ade46..21dceec06 100644
--- a/Library/Homebrew/utils/popen.rb
+++ b/Library/Homebrew/utils/popen.rb
@@ -14,7 +14,15 @@ module Utils
yield pipe
else
options[:err] ||= :close unless ENV["HOMEBREW_STDERR"]
- exec(*args, options)
+ begin
+ exec(*args, options)
+ rescue Errno::ENOENT
+ $stderr.puts "brew: command not found: #{args[0]}" unless options[:err] == :close
+ exit! 127
+ rescue SystemCallError
+ $stderr.puts "brew: exec failed: #{args[0]}" unless options[:err] == :close
+ exit! 1
+ end
end
end
end