Fix on_{system} handling of generic macOS versions

This commit is contained in:
Rylan Polster 2022-07-31 20:42:32 -04:00
parent ea1f2098ac
commit 58be76bc9d
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64

View File

@ -31,7 +31,11 @@ module OnSystem
return false if Homebrew::SimulateSystem.simulating_or_running_on_linux?
base_os = MacOS::Version.from_symbol(os_name)
current_os = MacOS::Version.from_symbol(Homebrew::SimulateSystem.current_os)
current_os = if Homebrew::SimulateSystem.current_os == :macos
Version::NULL
else
MacOS::Version.from_symbol(Homebrew::SimulateSystem.current_os)
end
return current_os >= base_os if or_condition == :or_newer
return current_os <= base_os if or_condition == :or_older