From 201a1ad9eb060fa2a12ffcb291501688d7a5f516 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 20 Apr 2014 17:00:44 -0500 Subject: [PATCH] Delay loading Pathname until we absolutely need it --- Library/ENV/4.3/xcrun | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun index 3bcfa89e40..5cb008fe94 100755 --- a/Library/ENV/4.3/xcrun +++ b/Library/ENV/4.3/xcrun @@ -4,15 +4,6 @@ # But many build-systems expect it to work. This fixes that. # NOTE only works if the build-tool calls xcrun without a path prefixed! -$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8" -require "pathname" - -def canonical_dirname path - Pathname.new(path).dirname.realpath.to_s -end - -SUPERBIN = canonical_dirname(__FILE__) - # Some build tools are stupid and still set DEVELOPER_DIR to old /Developer ENV.delete "DEVELOPER_DIR" @@ -25,6 +16,15 @@ if File.exist?("/usr/bin/#{ARGV.first}") exec "/usr/bin/#{ARGV.shift}", *ARGV unless sdkroot and File.directory? sdkroot end +$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8" +require "pathname" + +def canonical_dirname path + Pathname.new(path).dirname.realpath.to_s +end + +SUPERBIN = canonical_dirname(__FILE__) + def try path exec path, *ARGV if File.executable?(path) && canonical_dirname(path) != SUPERBIN end