Simpler Xcode prefix detection code
This commit is contained in:
parent
2c6d4973b9
commit
f6d5d812dc
@ -33,14 +33,15 @@ module OS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def prefix
|
def prefix
|
||||||
@prefix ||= begin
|
@prefix ||=
|
||||||
path = Pathname.new(MacOS.active_developer_dir)
|
begin
|
||||||
if path != CLT::MAVERICKS_PKG_PATH and path.absolute? \
|
dir = MacOS.active_developer_dir
|
||||||
and File.executable? "#{path}/usr/bin/make"
|
|
||||||
path
|
if dir.empty? || dir == CLT::MAVERICKS_PKG_PATH || !File.directory?(dir)
|
||||||
elsif (path = bundle_path)
|
path = bundle_path
|
||||||
path += "Contents/Developer"
|
path.join("Contents", "Developer") if path
|
||||||
path if File.executable? "#{path}/usr/bin/make"
|
else
|
||||||
|
Pathname.new(dir)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -146,7 +147,7 @@ module OS
|
|||||||
STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo"
|
STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo"
|
||||||
FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI"
|
FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI"
|
||||||
MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables"
|
MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables"
|
||||||
MAVERICKS_PKG_PATH = Pathname.new("/Library/Developer/CommandLineTools")
|
MAVERICKS_PKG_PATH = "/Library/Developer/CommandLineTools"
|
||||||
|
|
||||||
# Returns true even if outdated tools are installed, e.g.
|
# Returns true even if outdated tools are installed, e.g.
|
||||||
# tools from Xcode 4.x on 10.9
|
# tools from Xcode 4.x on 10.9
|
||||||
|
Loading…
x
Reference in New Issue
Block a user