Skip to content

Commit

Permalink
os/mac/diagnostic: check for OpenCore
Browse files Browse the repository at this point in the history
This configuration is not supported. Let's make `brew doctor` complain
about it.
  • Loading branch information
carlocab committed Nov 13, 2024
1 parent acb3675 commit 2c20e3b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Library/Homebrew/extend/os/mac/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,20 @@ def check_for_unsupported_macos
EOS
end

def check_for_opencore
has_opencore =
File.exist?("/Library/PrivilegedHelperTools/com.dortania.opencore-legacy-patcher.privileged-helper")
has_opencore ||= File.exist?("/Library/Application Support/Dortania/OpenCore-Patcher.app")
has_opencore ||= MacOS.pkgutil_info("com.dortania.opencore-legacy-patcher").present?

Check warning on line 135 in Library/Homebrew/extend/os/mac/diagnostic.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/extend/os/mac/diagnostic.rb#L133-L135

Added lines #L133 - L135 were not covered by tests
return unless has_opencore

<<~EOS

Check warning on line 138 in Library/Homebrew/extend/os/mac/diagnostic.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/extend/os/mac/diagnostic.rb#L138

Added line #L138 was not covered by tests
You have installed macOS using OpenCore Legacy Patcher.
We do not provide support for this configuration.
#{please_create_pull_requests}
EOS
end

def check_xcode_up_to_date
return unless MacOS::Xcode.outdated?

Expand Down

0 comments on commit 2c20e3b

Please sign in to comment.