diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index a2d6f19a72..c8439b06cd 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -433,9 +433,13 @@ module Homebrew locator = MacOS.sdk_locator source = if locator.source == :clt + return if MacOS::CLT.below_minimum_version? # Handled by other diagnostics. + update_instructions = MacOS::CLT.update_instructions "Command Line Tools (CLT)" else + return if MacOS::Xcode.below_minimum_version? # Handled by other diagnostics. + update_instructions = MacOS::Xcode.update_instructions "Xcode" end diff --git a/Library/Homebrew/test/os/mac/diagnostic_spec.rb b/Library/Homebrew/test/os/mac/diagnostic_spec.rb index e7bd09de12..c0a0e2573e 100644 --- a/Library/Homebrew/test/os/mac/diagnostic_spec.rb +++ b/Library/Homebrew/test/os/mac/diagnostic_spec.rb @@ -47,6 +47,8 @@ describe Homebrew::Diagnostic::Checks do before do allow(DevelopmentTools).to receive(:installed?).and_return(true) allow(OS::Mac).to receive(:version).and_return(macos_version) + allow(OS::Mac::CLT).to receive(:below_minimum_version?).and_return(false) + allow(OS::Mac::Xcode).to receive(:below_minimum_version?).and_return(false) end it "doesn't trigger when SDK root is not needed" do