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
commit22011d1118be5314d9160381f00fdd18afdb3849 (patch)
tree16876292d268b1cfb0842b3e879186313cafb2d4 /Library/ENV
parent8d4fe2fe7382284e826f219b9308825df1110e63 (diff)
downloadhomebrew-22011d1118be5314d9160381f00fdd18afdb3849.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)