From d2c27eff2a40055d8bb0ddefb87118993dc0aa6e Mon Sep 17 00:00:00 2001 From: Klaus Hipp Date: Sun, 13 Oct 2024 20:40:55 +0200 Subject: [PATCH] kekaexternalhelper: add livecheck --- Casks/k/kekaexternalhelper.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Casks/k/kekaexternalhelper.rb b/Casks/k/kekaexternalhelper.rb index d8c04d95b3de6..b0411b3ae3a4d 100644 --- a/Casks/k/kekaexternalhelper.rb +++ b/Casks/k/kekaexternalhelper.rb @@ -14,7 +14,16 @@ # through the headers for all responses (not the hash of merged headers, # where only the last `location` header is available). livecheck do - skip "Cannot identify version without access to all headers" + url :url + regex(%r{/v?(\d+(?:\.\d+)+)/KekaExternalHelper[._-]v?(\d+(?:\.\d+)+)\.zip$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.blank? + + "#{match[2]},#{match[1]}" + end + end end app "KekaExternalHelper.app"