Merge pull request #833 from DomT4/death_by_xcode
xcode: die unless Xcode/CLT up-to-date on prerelease macOS
This commit is contained in:
commit
d1ba4f44c0
@ -223,9 +223,16 @@ module Homebrew
|
|||||||
|
|
||||||
def check_development_tools
|
def check_development_tools
|
||||||
checks = Diagnostic::Checks.new
|
checks = Diagnostic::Checks.new
|
||||||
checks.all_development_tools_checks.each do |check|
|
all_development_tools_checks = checks.development_tools_checks +
|
||||||
|
checks.fatal_development_tools_checks
|
||||||
|
all_development_tools_checks.each do |check|
|
||||||
out = checks.send(check)
|
out = checks.send(check)
|
||||||
opoo out unless out.nil?
|
next if out.nil?
|
||||||
|
if checks.fatal_development_tools_checks.include?(check)
|
||||||
|
odie out
|
||||||
|
else
|
||||||
|
opoo out
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -87,12 +87,17 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
############# END HELPERS
|
############# END HELPERS
|
||||||
|
|
||||||
def all_development_tools_checks
|
def development_tools_checks
|
||||||
%w[
|
%w[
|
||||||
check_for_installed_developer_tools
|
check_for_installed_developer_tools
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def fatal_development_tools_checks
|
||||||
|
%w[
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
def check_for_installed_developer_tools
|
def check_for_installed_developer_tools
|
||||||
return if DevelopmentTools.installed?
|
return if DevelopmentTools.installed?
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
module Homebrew
|
module Homebrew
|
||||||
module Diagnostic
|
module Diagnostic
|
||||||
class Checks
|
class Checks
|
||||||
def all_development_tools_checks
|
def development_tools_checks
|
||||||
%w[
|
%w[
|
||||||
check_for_unsupported_osx
|
check_for_unsupported_osx
|
||||||
check_for_prerelease_xcode
|
check_for_prerelease_xcode
|
||||||
@ -12,6 +12,18 @@ module Homebrew
|
|||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def fatal_development_tools_checks
|
||||||
|
if MacOS.prerelease?
|
||||||
|
%w[
|
||||||
|
check_xcode_up_to_date
|
||||||
|
check_clt_up_to_date
|
||||||
|
]
|
||||||
|
else
|
||||||
|
%w[
|
||||||
|
]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def check_for_unsupported_osx
|
def check_for_unsupported_osx
|
||||||
return if ARGV.homebrew_developer?
|
return if ARGV.homebrew_developer?
|
||||||
|
|
||||||
@ -51,10 +63,17 @@ module Homebrew
|
|||||||
def check_xcode_up_to_date
|
def check_xcode_up_to_date
|
||||||
return unless MacOS::Xcode.installed? && MacOS::Xcode.outdated?
|
return unless MacOS::Xcode.installed? && MacOS::Xcode.outdated?
|
||||||
|
|
||||||
|
if OS::Mac.prerelease?
|
||||||
|
xcode_select_nudge = <<-EOS.undent
|
||||||
|
If #{MacOS::Xcode.latest_version} is installed, you may need to:
|
||||||
|
sudo xcode-select --switch /path/to/Xcode-beta.app
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
<<-EOS.undent
|
<<-EOS.undent
|
||||||
Your Xcode (#{MacOS::Xcode.version}) is outdated
|
Your Xcode (#{MacOS::Xcode.version}) is outdated
|
||||||
Please update to Xcode #{MacOS::Xcode.latest_version}.
|
Please update to Xcode #{MacOS::Xcode.latest_version}.
|
||||||
#{MacOS::Xcode.update_instructions}
|
#{MacOS::Xcode.update_instructions}#{xcode_select_nudge}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user