Use Formula#system and existing error handling in scons helper

Fixes Homebrew/homebrew#27553.
This commit is contained in:
Jack Nagel 2014-03-14 16:41:57 -05:00
parent 251bd707a2
commit a867cb4305

View File

@ -85,9 +85,7 @@ module FileUtils extend self
# Run scons using a Homebrew-installed version, instead of whatever # Run scons using a Homebrew-installed version, instead of whatever
# is in the user's PATH # is in the user's PATH
def scons *args def scons *args
scons = Formulary.factory("scons").opt_prefix/'bin/scons' system Formulary.factory("scons").opt_bin/"scons", *args
raise "#{scons} is not executable" unless scons.exist? and scons.executable?
safe_system scons, *args
end end
def rake *args def rake *args