repair if condition

This commit is contained in:
hyuraku 2023-01-25 17:23:44 +09:00
parent 8289089482
commit 42960c3e74
2 changed files with 14 additions and 9 deletions

View File

@ -1,10 +1,8 @@
# typed: true
# frozen_string_literal: true
require "simulate_system"
if OS.mac? && Hardware::CPU.arm?
if OS.mac?
require "extend/os/mac/default_prefix"
elsif Homebrew::SimulateSystem.simulating_or_running_on_linux?
elsif OS.linux?
require "extend/os/linux/default_prefix"
end

View File

@ -1,10 +1,17 @@
# typed: true
# frozen_string_literal: true
module Homebrew
remove_const(:DEFAULT_PREFIX)
DEFAULT_PREFIX = HOMEBREW_MACOS_ARM_DEFAULT_PREFIX
require "simulate_system"
remove_const(:DEFAULT_REPOSITORY)
DEFAULT_REPOSITORY = HOMEBREW_MACOS_ARM_DEFAULT_REPOSITORY
module Homebrew
if Hardware::CPU.arm? || Homebrew::SimulateSystem.simulating_or_running_on_linux?
remove_const(:DEFAULT_PREFIX)
remove_const(:DEFAULT_REPOSITORY)
DEFAULT_PREFIX, DEFAULT_REPOSITORY = if Hardware::CPU.arm?
[HOMEBREW_MACOS_ARM_DEFAULT_PREFIX, HOMEBREW_MACOS_ARM_DEFAULT_REPOSITORY]
elsif Homebrew::SimulateSystem.simulating_or_running_on_linux?
[HOMEBREW_LINUX_DEFAULT_PREFIX, HOMEBREW_LINUX_DEFAULT_REPOSITORY]
end
end
end