move default_prefix to extend/os
This commit is contained in:
parent
d636f5bc0a
commit
e2f0075ee8
@ -1,15 +1,7 @@
|
|||||||
# typed: true
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "simulate_system"
|
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
# TODO: Refactor and move to extend/os
|
DEFAULT_PREFIX = HOMEBREW_DEFAULT_PREFIX
|
||||||
DEFAULT_PREFIX, DEFAULT_REPOSITORY = if OS.mac? && Hardware::CPU.arm? # rubocop:disable Homebrew/MoveToExtendOS
|
DEFAULT_REPOSITORY = HOMEBREW_DEFAULT_REPOSITORY
|
||||||
[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]
|
|
||||||
else
|
|
||||||
[HOMEBREW_DEFAULT_PREFIX, HOMEBREW_DEFAULT_REPOSITORY]
|
|
||||||
end.freeze
|
|
||||||
end
|
end
|
||||||
|
|||||||
10
Library/Homebrew/extend/os/default_prefix.rb
Normal file
10
Library/Homebrew/extend/os/default_prefix.rb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# typed: true
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "simulate_system"
|
||||||
|
|
||||||
|
if OS.mac? && Hardware::CPU.arm?
|
||||||
|
require "extend/os/mac/default_prefix"
|
||||||
|
elsif Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||||
|
require "extend/os/linux/default_prefix"
|
||||||
|
end
|
||||||
7
Library/Homebrew/extend/os/linux/default_prefix.rb
Normal file
7
Library/Homebrew/extend/os/linux/default_prefix.rb
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# typed: true
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Homebrew
|
||||||
|
DEFAULT_PREFIX = HOMEBREW_LINUX_DEFAULT_PREFIX
|
||||||
|
DEFAULT_REPOSITORY = HOMEBREW_LINUX_DEFAULT_REPOSITORY
|
||||||
|
end
|
||||||
7
Library/Homebrew/extend/os/mac/default_prefix.rb
Normal file
7
Library/Homebrew/extend/os/mac/default_prefix.rb
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# typed: true
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Homebrew
|
||||||
|
DEFAULT_PREFIX = HOMEBREW_MACOS_ARM_DEFAULT_PREFIX
|
||||||
|
DEFAULT_REPOSITORY = HOMEBREW_MACOS_ARM_DEFAULT_REPOSITORY
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user