aboutsummaryrefslogtreecommitdiffstats
path: root/Library/ENV
diff options
context:
space:
mode:
authorJack Nagel2014-04-29 21:51:17 -0500
committerJack Nagel2014-04-29 21:51:17 -0500
commit2a81f8c305e9c2cbf2c3b9fc85885778e61cfd29 (patch)
treefe5b51ff7eb11516174339a21315533968ea9bb0 /Library/ENV
parentc6c9aa546f9eaf2e93ae67d95ebb94b383c177fc (diff)
downloadbrew-2a81f8c305e9c2cbf2c3b9fc85885778e61cfd29.tar.bz2
xcrun wrapper: inline try method
Diffstat (limited to 'Library/ENV')
-rwxr-xr-xLibrary/ENV/4.3/xcrun9
1 files changed, 4 insertions, 5 deletions
diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun
index 1dca66b65..940358c2c 100755
--- a/Library/ENV/4.3/xcrun
+++ b/Library/ENV/4.3/xcrun
@@ -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)