Start cleaning up Xcode.version
This commit is contained in:
parent
9d02c39e23
commit
538dea98ad
@ -81,23 +81,13 @@ module OS
|
|||||||
|
|
||||||
return "0" unless OS.mac?
|
return "0" unless OS.mac?
|
||||||
|
|
||||||
# this shortcut makes version work for people who don't realise you
|
%W[#{prefix}/usr/bin/xcodebuild #{which("xcodebuild")}].uniq.each do |path|
|
||||||
# need to install the CLI tools
|
if File.file? path
|
||||||
# TODO investigate and update the above comment; what does this mean
|
`#{path} -version 2>/dev/null` =~ /Xcode (\d(\.\d)*)/
|
||||||
# for modern installs (Xcode 5 on 10.8/9)?
|
|
||||||
xcode43build = Pathname.new("#{prefix}/usr/bin/xcodebuild")
|
|
||||||
if xcode43build.file?
|
|
||||||
`#{xcode43build} -version 2>/dev/null` =~ /Xcode (\d(\.\d)*)/
|
|
||||||
return $1 if $1
|
return $1 if $1
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
xcodebuild = which "xcodebuild"
|
|
||||||
raise unless xcodebuild && xcodebuild != xcode43build
|
|
||||||
|
|
||||||
`xcodebuild -version 2>/dev/null` =~ /Xcode (\d(\.\d)*)/
|
|
||||||
raise if $1.nil? or not $?.success?
|
|
||||||
$1
|
|
||||||
rescue
|
|
||||||
# For people who's xcode-select is unset, or who have installed
|
# For people who's xcode-select is unset, or who have installed
|
||||||
# xcode-gcc-installer or whatever other combinations we can try and
|
# xcode-gcc-installer or whatever other combinations we can try and
|
||||||
# supprt. See https://github.com/Homebrew/homebrew/wiki/Xcode
|
# supprt. See https://github.com/Homebrew/homebrew/wiki/Xcode
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user