Skip to content

Commit

Permalink
os/mac/diagnostic: improve OpenCore check
Browse files Browse the repository at this point in the history
This is based on [1].

[1]: #18765 (comment)
  • Loading branch information
ZhongRuoyu committed Nov 13, 2024
1 parent 5a2c264 commit d0418ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Library/Homebrew/extend/os/mac/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,14 @@ def check_for_unsupported_macos

def check_for_opencore
return if ::Hardware::CPU.physical_cpu_arm64?
return if ENV["CI"]

# https://dortania.github.io/OpenCore-Legacy-Patcher/UPDATE.html#checking-oclp-and-opencore-versions
begin
opencore_version = Utils.safe_popen_read("/usr/sbin/nvram",
"4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:opencore-version").split[1]
return if opencore_version.blank?
oclp_version = Utils.safe_popen_read("/usr/sbin/nvram",

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
"4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:oclp-version").split[1]
return if opencore_version.blank? || oclp_version.blank?
rescue ErrorDuringExecution
return
end
Expand Down

0 comments on commit d0418ad

Please sign in to comment.