xcrun wrapper: inline try method
This commit is contained in:
parent
c6c9aa546f
commit
2a81f8c305
@ -25,12 +25,11 @@ end
|
||||
|
||||
SUPERBIN = canonical_dirname(__FILE__)
|
||||
|
||||
def try path
|
||||
exec path, *ARGV if File.executable?(path) && canonical_dirname(path) != SUPERBIN
|
||||
end
|
||||
|
||||
arg0 = ARGV.shift
|
||||
try `/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
|
||||
exec(exe, *ARGV)
|
||||
end
|
||||
|
||||
paths = ENV["PATH"].split(File::PATH_SEPARATOR)
|
||||
paths.delete(SUPERBIN)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user