Skip to content

Commit 99681d7

Browse files
committed
bump-cask-pr: replace "host" naming with "current"
`Homebrew::SimulateSystem.current_os` may be returning the host OS or a simulated OS and we can't be sure which in this context. At the moment, this is expected to be the host OS but that may change in the future. It shouldn't matter on a technical level but using "host" in these variable names may lead to confusion. This replaces "host" in names with "current", as it more accurately describes the information.
1 parent b7065d5 commit 99681d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Library/Homebrew/dev-cmd/bump-cask-pr.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ def shortened_version(version, cask:)
183183

184184
sig { params(cask: Cask::Cask).returns(T::Array[[Symbol, Symbol]]) }
185185
def generate_system_options(cask)
186-
host_os = Homebrew::SimulateSystem.current_os
187-
host_is_macos = MacOSVersion::SYMBOLS.include?(host_os)
186+
current_os = Homebrew::SimulateSystem.current_os
187+
current_os_is_macos = MacOSVersion::SYMBOLS.include?(current_os)
188188
newest_macos = MacOSVersion::SYMBOLS.keys.first
189189

190190
depends_on_archs = cask.depends_on.arch&.filter_map { |arch| arch[:type] }&.uniq
@@ -197,7 +197,7 @@ def generate_system_options(cask)
197197
if cask.on_system_blocks_exist?
198198
OnSystem::BASE_OS_OPTIONS.each do |os|
199199
os_values << if os == :macos
200-
(host_is_macos ? host_os : newest_macos)
200+
(current_os_is_macos ? current_os : newest_macos)
201201
else
202202
os
203203
end
@@ -208,7 +208,7 @@ def generate_system_options(cask)
208208
# Architecture is only relevant if on_system blocks are present or
209209
# the cask uses `depends_on arch`, otherwise we default to ARM for
210210
# consistency.
211-
os_values << (host_is_macos ? host_os : newest_macos)
211+
os_values << (current_os_is_macos ? current_os : newest_macos)
212212
arch_values << :arm if arch_values.empty?
213213
end
214214

0 commit comments

Comments
 (0)