From 1007f3309a1d2e7873ccfbd9ee8e41288dd17d10 Mon Sep 17 00:00:00 2001 From: Bevan Kay Date: Mon, 6 Nov 2023 13:03:50 +1100 Subject: [PATCH] celestia 1.6.3 --- Casks/c/celestia.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Casks/c/celestia.rb b/Casks/c/celestia.rb index 0f2558d2fa..f191ca7078 100644 --- a/Casks/c/celestia.rb +++ b/Casks/c/celestia.rb @@ -7,9 +7,23 @@ cask "celestia" do desc "Space simulation for exploring the universe in three dimensions" homepage "https://github.com/CelestiaProject/Celestia/" + # Not every GitHub release provides a file for macOS, so we check multiple + # recent releases instead of only the "latest" release. livecheck do url :url - strategy :github_latest + regex(/^celestia[._-]v?(\d+(?:\.\d+)+)[._-]?(macOS)?\.(?:dmg|pkg|zip)$/i) + strategy :github_releases do |json, regex| + json.map do |release| + next if release["draft"] || release["prerelease"] + + release["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.blank? + + match[1] + end + end.flatten + end end app "Celestia.app"