aboutsummaryrefslogtreecommitdiffstats
path: root/Library/ENV
diff options
context:
space:
mode:
authorJack Nagel2014-04-20 17:00:44 -0500
committerJack Nagel2014-04-20 17:00:44 -0500
commit052cb3adaca1b936ae60f63dab31dbec3e71066f (patch)
treeac2beaa414af9e35b731957daf634b1466e7a43a /Library/ENV
parent370fc7baecb0f8f4eecd15c8957948029e583357 (diff)
downloadhomebrew-052cb3adaca1b936ae60f63dab31dbec3e71066f.tar.bz2
Delay loading Pathname until we absolutely need it
Diffstat (limited to 'Library/ENV')
-rwxr-xr-xLibrary/ENV/4.3/xcrun18
1 files changed, 9 insertions, 9 deletions
diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun
index 3bcfa89e4..5cb008fe9 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