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