xcrun wrapper: reorganize so we only access ARGV once
This commit is contained in:
parent
2a81f8c305
commit
4cff03b730
@ -11,9 +11,12 @@ if ARGV.empty? || ARGV[0][0..0] == "-"
|
|||||||
exec "/usr/bin/xcrun", *ARGV
|
exec "/usr/bin/xcrun", *ARGV
|
||||||
end
|
end
|
||||||
|
|
||||||
if File.exist?("/usr/bin/#{ARGV.first}")
|
arg0 = ARGV.shift
|
||||||
sdkroot = ENV['HOMEBREW_SDKROOT']
|
|
||||||
exec "/usr/bin/#{ARGV.shift}", *ARGV unless sdkroot and File.directory? sdkroot
|
exe = "/usr/bin/#{arg0}"
|
||||||
|
if File.executable?(exe)
|
||||||
|
sdkroot = ENV["HOMEBREW_SDKROOT"]
|
||||||
|
exec(exe, *ARGV) unless sdkroot && File.directory?(sdkroot)
|
||||||
end
|
end
|
||||||
|
|
||||||
$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
|
$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
|
||||||
@ -25,7 +28,6 @@ end
|
|||||||
|
|
||||||
SUPERBIN = canonical_dirname(__FILE__)
|
SUPERBIN = canonical_dirname(__FILE__)
|
||||||
|
|
||||||
arg0 = ARGV.shift
|
|
||||||
exe = `/usr/bin/xcrun --find #{arg0} 2>/dev/null`.chomp
|
exe = `/usr/bin/xcrun --find #{arg0} 2>/dev/null`.chomp
|
||||||
if File.executable?(exe) && canonical_dirname(exe) != SUPERBIN
|
if File.executable?(exe) && canonical_dirname(exe) != SUPERBIN
|
||||||
exec(exe, *ARGV)
|
exec(exe, *ARGV)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user