Skip items strategy blocks in #livecheck_min_os

The `#livecheck_min_os` cask audit method should be skipped when a
`Sparkle` `livecheck` block contains a `strategy` block that uses
the `items` argument (instead of `item`). These `strategy` blocks
contain arbitrary logic that ignores/overrides the strategy's sorting,
so we can't identify which item would be first/newest.
This commit is contained in:
Sam Ford 2023-11-08 09:13:09 -05:00
parent bc2ce97e5d
commit d376b46a7d
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D

View File

@ -597,6 +597,12 @@ module Cask
return unless cask.livecheckable?
return if cask.livecheck.strategy != :sparkle
# `Sparkle` strategy blocks that use the `items` argument (instead of
# `item`) contain arbitrary logic that ignores/overrides the strategy's
# sorting, so we can't identify which item would be first/newest here.
return if cask.livecheck.strategy_block.present? &&
cask.livecheck.strategy_block.parameters[0] == [:opt, :items]
out, _, status = curl_output("--fail", "--silent", "--location", cask.livecheck.url)
return unless status.success?