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

24 lines
632 B
Ruby
Raw Normal View History

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