From f2973692d26fbf9b1dcdfe1cac2b37e96733c1db Mon Sep 17 00:00:00 2001 From: Patrick Linnane Date: Wed, 18 Oct 2023 12:07:23 -0700 Subject: [PATCH] appium-inspector: update livecheck --- Casks/a/appium-inspector.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Casks/a/appium-inspector.rb b/Casks/a/appium-inspector.rb index ea4b404be4..2aab67c899 100644 --- a/Casks/a/appium-inspector.rb +++ b/Casks/a/appium-inspector.rb @@ -7,9 +7,23 @@ cask "appium-inspector" do desc "GUI inspector for mobile apps" homepage "https://github.com/appium/appium-inspector/" + # 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(/^Appium.*?mac[._-]v?(\d+(?:\.\d+)+)\.(?: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 "Appium Inspector.app"