2024-08-15 07:59:49 -07:00
|
|
|
# typed: strict
|
2022-11-21 21:04:22 -08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-09-18 15:33:49 -07:00
|
|
|
module OS
|
|
|
|
module Mac
|
|
|
|
module SimulateSystem
|
|
|
|
sig { returns(T::Boolean) }
|
|
|
|
def simulating_or_running_on_macos?
|
2024-09-19 10:43:05 -07:00
|
|
|
return true if Homebrew::SimulateSystem.os.blank?
|
|
|
|
|
|
|
|
[:macos, *MacOSVersion::SYMBOLS.keys].include?(Homebrew::SimulateSystem.os)
|
2024-09-18 15:33:49 -07:00
|
|
|
end
|
2022-11-21 21:04:22 -08:00
|
|
|
|
2024-09-18 15:33:49 -07:00
|
|
|
sig { returns(Symbol) }
|
|
|
|
def current_os
|
2024-09-21 12:24:21 -07:00
|
|
|
::Homebrew::SimulateSystem.os || MacOS.version.to_sym
|
2024-09-13 12:22:52 -07:00
|
|
|
end
|
2022-11-21 21:04:22 -08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2024-09-05 19:56:32 -07:00
|
|
|
|
2024-09-18 15:33:49 -07:00
|
|
|
Homebrew::SimulateSystem.singleton_class.prepend(OS::Mac::SimulateSystem)
|