Skip to content
Snippets Groups Projects
Commit f1cc1265 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

Refactor MacOS check_development_tools usage.

Better use the abstraction layer so e.g. Linux could have similarly
fatal checks for these things.
parent 921aa015
No related branches found
No related tags found
No related merge requests found
......@@ -223,14 +223,15 @@ module Homebrew
def check_development_tools
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)
opoo out unless out.nil?
end
if OS.mac? && MacOS.prerelease?
checks.strict_development_tools_checks.each do |strict_check|
out = checks.send(strict_check)
odie out unless out.nil?
next if out.nil?
if checks.fatal_development_tools_checks.include?(check)
odie out
else
opoo out
end
end
end
......
......@@ -86,12 +86,17 @@ module Homebrew
end
############# END HELPERS
def all_development_tools_checks
def development_tools_checks
%w[
check_for_installed_developer_tools
]
end
def fatal_development_tools_checks
%w[
]
end
def check_for_installed_developer_tools
return if DevelopmentTools.installed?
......
module Homebrew
module Diagnostic
class Checks
def all_development_tools_checks
def development_tools_checks
%w[
check_for_unsupported_osx
check_for_prerelease_xcode
......@@ -12,11 +12,16 @@ module Homebrew
]
end
def strict_development_tools_checks
%w[
check_xcode_up_to_date
check_clt_up_to_date
]
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
......
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