Skip to content

Commit dbb02e7

Browse files
SMillerDevCopilot
andcommitted
Update Library/Homebrew/cask/cask.rb
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 56e832f commit dbb02e7

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Library/Homebrew/cask/cask.rb

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,21 +179,24 @@ def contains_os_specific_artifacts?
179179
any_loaded = false
180180
@contains_os_specific_artifacts ||= begin
181181
OnSystem::VALID_OS_ARCH_TAGS.each do |bottle_tag|
182-
Homebrew::SimulateSystem.with_tag(bottle_tag) do
183-
refresh
182+
begin
183+
Homebrew::SimulateSystem.with_tag(bottle_tag) do
184+
refresh
184185

185-
any_loaded = true if artifacts.any? do |artifact|
186-
(bottle_tag.linux? && ::Cask::Artifact::MACOS_ONLY_ARTIFACTS.include?(artifact.class)) ||
187-
(bottle_tag.macos? && ::Cask::Artifact::LINUX_ONLY_ARTIFACTS.include?(artifact.class))
186+
any_loaded = true if artifacts.any? do |artifact|
187+
(bottle_tag.linux? && ::Cask::Artifact::MACOS_ONLY_ARTIFACTS.include?(artifact.class)) ||
188+
(bottle_tag.macos? && ::Cask::Artifact::LINUX_ONLY_ARTIFACTS.include?(artifact.class))
189+
end
188190
end
191+
rescue CaskInvalidError
192+
# Invalid for this OS/arch tag; treat as having no OS-specific artifacts.
193+
next
194+
ensure
195+
refresh
189196
end
190197
end
191198

192199
any_loaded
193-
rescue CaskInvalidError
194-
# Invalid cask
195-
ensure
196-
refresh
197200
end
198201

199202
@contains_os_specific_artifacts

0 commit comments

Comments
 (0)