Skip to content
Snippets Groups Projects
Commit 201a1ad9 authored by Jack Nagel's avatar Jack Nagel
Browse files

Delay loading Pathname until we absolutely need it

parent a00dcd00
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment