diff --git a/Library/Homebrew/mach.rb b/Library/Homebrew/mach.rb index 0a0a3e2896..d63edc6fe1 100644 --- a/Library/Homebrew/mach.rb +++ b/Library/Homebrew/mach.rb @@ -155,7 +155,10 @@ module MachO def parse_otool_L_output ENV["HOMEBREW_MACH_O_FILE"] = path.expand_path.to_s libs = `#{MacOS.locate("otool")} -L "$HOMEBREW_MACH_O_FILE"`.split("\n") - return nil, [] if libs.empty? + unless $?.success? + raise ErrorDuringExecution.new(MacOS.locate("otool"), + ["-L", ENV["HOMEBREW_MACH_O_FILE"]]) + end libs.shift # first line is the filename