diff --git a/Casks/l/lightkey.rb b/Casks/l/lightkey.rb index a0e80b0e9c..39ca0ec232 100644 --- a/Casks/l/lightkey.rb +++ b/Casks/l/lightkey.rb @@ -3,8 +3,21 @@ cask "lightkey" do version "4.4.5" sha256 "457df4bb2d2f21a52eec9b9b05830eb082014ce66fd79f91544a0838d54a3241" + # This check should only return legacy versions and the conditions may need + # to be updated as the minimum system version of releases changes. If/when + # upstream stops publishing new legacy versions, this should be updated to + # use `skip` instead. livecheck do - skip "Legacy version" + url "https://lightkeyapp.com/en/update" + strategy :sparkle do |items| + items.map do |item| + next unless item.minimum_system_version + next if item.minimum_system_version < :big_sur || + item.minimum_system_version >= :ventura + + item.version + end + end end depends_on macos: ">= :big_sur" @@ -13,8 +26,10 @@ cask "lightkey" do version "4.6" sha256 "fccd39bd1cde1ff01a04194643bd8d17fc593e4c6b82a058e22e41471fed41a9" - # Updates for legacy versions are included so sorting by release date - # return false positives, pass all version numbers to livecheck instead + # Upstream also publishes legacy versions (with a lower minor version) in + # the appcast, so the first `item` after sorting by `pubDate`/`version` may + # not be the highest version. This `strategy` block collects the `version` + # from all `items`, ignoring the `Sparkle` strategy's `pubDate` sorting. livecheck do url "https://lightkeyapp.com/en/update" strategy :sparkle do |items|