From 89a46f10aa9d27c1c8e7e766bb8d8399c4e3c23b Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Sat, 30 Nov 2024 21:44:30 -0500 Subject: [PATCH] caido: update livecheck The existing `livecheck` block for `caido` only contains a URL for the GitHub repository, so it checks the repository's Git tags. However, the cask `url` is a first-party asset from caido.download, so the check doesn't closely align with the cask `url` source. [The GitHub release descriptions contain links to the caido.download files but this `livecheck` block simply checks the Git tags.] The existing check technically works but we can update it to better align with the cask `url` source. The first-party download page has buttons to download the desktop app and this triggers an API request that returns JSON information about the latest release. This updates the `livecheck` block to check that URL and use the `version` field from the JSON response. --- Casks/c/caido.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Casks/c/caido.rb b/Casks/c/caido.rb index 3ca0f74153d2..bb5e4daf1380 100644 --- a/Casks/c/caido.rb +++ b/Casks/c/caido.rb @@ -12,7 +12,10 @@ homepage "https://caido.io/" livecheck do - url "https://github.com/caido/caido/" + url "https://api.caido.io/releases/latest" + strategy :json do |json| + json["version"] + end end depends_on macos: ">= :catalina"