From 2a81f8c305e9c2cbf2c3b9fc85885778e61cfd29 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 29 Apr 2014 21:51:17 -0500 Subject: [PATCH] xcrun wrapper: inline try method --- Library/ENV/4.3/xcrun | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun index 1dca66b65b..940358c2c7 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)