diff options
| author | Jack Nagel | 2014-04-20 17:00:44 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-04-20 17:00:44 -0500 |
| commit | 201a1ad9eb060fa2a12ffcb291501688d7a5f516 (patch) | |
| tree | 4232c6fcb37ec4c6a1b7994827c8e8eb372d67c4 /Library | |
| parent | a00dcd007965102160244a0cde0366e4825aa485 (diff) | |
| download | brew-201a1ad9eb060fa2a12ffcb291501688d7a5f516.tar.bz2 | |
Delay loading Pathname until we absolutely need it
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/ENV/4.3/xcrun | 18 |
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 |
