Stop loading a bunch of monkeypatches every time xcrun is invoked
This commit is contained in:
parent
91cc7aca49
commit
275e66e08d
@ -4,9 +4,14 @@
|
|||||||
# But many build-systems expect it to work. This fixes that.
|
# But many build-systems expect it to work. This fixes that.
|
||||||
# NOTE only works if the build-tool calls xcrun without a path prefixed!
|
# NOTE only works if the build-tool calls xcrun without a path prefixed!
|
||||||
|
|
||||||
dirname = File.dirname(__FILE__)
|
$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
|
||||||
require File.expand_path("../libsuperenv", dirname)
|
require "pathname"
|
||||||
SUPERBIN = dirname.cleanpath.freeze
|
|
||||||
|
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
|
# Some build tools are stupid and still set DEVELOPER_DIR to old /Developer
|
||||||
ENV.delete "DEVELOPER_DIR"
|
ENV.delete "DEVELOPER_DIR"
|
||||||
@ -18,7 +23,7 @@ if File.exist?("/usr/bin/#{ARGV.first}")
|
|||||||
end
|
end
|
||||||
|
|
||||||
def try path
|
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
|
end
|
||||||
|
|
||||||
arg0 = ARGV.shift
|
arg0 = ARGV.shift
|
||||||
|
Loading…
x
Reference in New Issue
Block a user