brew/Library/Homebrew/extend/os/mac/simulate_system.rb

25 lines
610 B
Ruby
Raw Normal View History

# 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
module ClassMethods
sig { returns(T::Boolean) }
def simulating_or_running_on_macos?
return true if Homebrew::SimulateSystem.os.blank?
2024-09-19 10:43:05 -07:00
[:macos, *MacOSVersion::SYMBOLS.keys].include?(Homebrew::SimulateSystem.os)
end
2022-11-21 21:04:22 -08:00
sig { returns(Symbol) }
def current_os
::Homebrew::SimulateSystem.os || MacOS.version.to_sym
end
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
Homebrew::SimulateSystem.singleton_class.prepend(OS::Mac::SimulateSystem::ClassMethods)