diff options
| author | Jack Nagel | 2014-04-20 16:48:55 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-04-20 16:48:55 -0500 |
| commit | 275e66e08d3dd8870a8b06b4a1b9e45adf52e1ea (patch) | |
| tree | ce544755e7c8221a0e1876913acf587841f73d86 /Library | |
| parent | 91cc7aca49b29b801bd72bb8872056e972a96f4f (diff) | |
| download | brew-275e66e08d3dd8870a8b06b4a1b9e45adf52e1ea.tar.bz2 | |
Stop loading a bunch of monkeypatches every time xcrun is invoked
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/ENV/4.3/xcrun | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun index c6f923c16..0cef2bbfb 100755 --- a/Library/ENV/4.3/xcrun +++ b/Library/ENV/4.3/xcrun @@ -4,9 +4,14 @@ # But many build-systems expect it to work. This fixes that. # NOTE only works if the build-tool calls xcrun without a path prefixed! -dirname = File.dirname(__FILE__) -require File.expand_path("../libsuperenv", dirname) -SUPERBIN = dirname.cleanpath.freeze +$:.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" @@ -18,7 +23,7 @@ if File.exist?("/usr/bin/#{ARGV.first}") end def try path - exec path, *ARGV if File.executable?(path) and File.dirname(path.cleanpath) != SUPERBIN + exec path, *ARGV if File.executable?(path) && canonical_dirname(path) != SUPERBIN end arg0 = ARGV.shift |
