Merge pull request #194004 from Homebrew/bump-binance-1.54.4
[Homebrew/homebrew-cask.git] / Casks / k / kekaexternalhelper.rb
blob401e71167893e4a2b0652348de77abeb3ef8914e
1 cask "kekaexternalhelper" do
2   version "1.2.0,1.4.4"
3   sha256 "6857bb22694b6f6c01a13c40953b0a04b1704acf90da414a7476be63961d9827"
5   url "https://github.com/aonez/Keka/releases/download/v#{version.csv.second}/KekaExternalHelper-v#{version.csv.first}.zip"
6   name "Keka External Helper"
7   name "KekaDefaultApp"
8   desc "Helper application for the Keka file archiver"
9   homepage "https://github.com/aonez/Keka/wiki/Default-application"
11   # We can identify the version from the `location` header of the first
12   # response from https://d.keka.io/helper/ but we need to be able to either not
13   # follow redirections (i.e., omit `--location` from curl args) or iterate
14   # through the headers for all responses (not the hash of merged headers,
15   # where only the last `location` header is available).
16   livecheck do
17     url :url
18     regex(%r{/v?(\d+(?:\.\d+)+)/KekaExternalHelper[._-]v?(\d+(?:\.\d+)+)\.zip$}i)
19     strategy :github_releases do |json, regex|
20       json.map do |release|
21         next if release["draft"] || release["prerelease"]
23         release["assets"]&.map do |asset|
24           match = asset["browser_download_url"]&.match(regex)
25           next if match.blank?
27           "#{match[2]},#{match[1]}"
28         end
29       end.flatten
30     end
31   end
33   app "KekaExternalHelper.app"
35   zap trash: [
36     "~/Library/Containers/com.aone.keka",
37     "~/Library/Saved Application State/com.aone.KekaExternalHelper.savedState",
38   ]
39 end