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

19 lines
463 B
Ruby
Raw Normal View History

# 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)