diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun index 3526c804c1..68fda5829b 100755 --- a/Library/ENV/4.3/xcrun +++ b/Library/ENV/4.3/xcrun @@ -8,14 +8,16 @@ require "#{File.dirname __FILE__}/../libsuperenv" SUPERBIN = __FILE__.dirname.cleanpath.freeze exec "/usr/bin/xcrun", *ARGV if ARGV.empty? or ARGV[0][0..0] == '-' -exec "/usr/bin/#{ARGV.shift}", *ARGV unless ENV['HOMEBREW_SDKROOT'].directory? +if File.exist?("/usr/bin/#{ARGV.first}") + exec "/usr/bin/#{ARGV.shift}", *ARGV unless ENV['HOMEBREW_SDKROOT'].directory? +end def try path exec path, *ARGV if File.executable?(path) and path.cleanpath.dirname != SUPERBIN end arg0 = ARGV.shift -try `/usr/bin/xcrun --find #{arg0}` +try `/usr/bin/xcrun --find #{arg0}`.chomp # Nuts, Xcode is not setup properly or something. Try to find the tools anyway! try "/Applications/Xcode.app/Contents/Developer/usr/bin/#{arg0}" try "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/#{arg0}"