Merge pull request #194004 from Homebrew/bump-binance-1.54.4
[Homebrew/homebrew-cask.git] / Casks / k / katrain.rb
blob287b50cc416767b9fb7f2aadc24614e1c8533c6f
1 cask "katrain" do
2   version "1.14.0"
3   sha256 "38cfe45fd4440983d3cbf4ca1305fa977c8479a16f6696bd22742ad451fa4cd7"
5   on_arm do
6     depends_on formula: "katago"
7   end
9   url "https://github.com/sanderland/katrain/releases/download/v#{version}/KaTrainOSX.dmg"
10   name "KaTrain"
11   desc "Tool for analyzing games and playing go with AI feedback from KataGo"
12   homepage "https://github.com/sanderland/katrain"
14   # Most recent release doesn't provide a file forr macOS, so we check multiple
15   # recent releases instead of only the "latest" release. NOTE: We should be
16   # able to remove this next release when upstream provides a file for macOS again.
17   livecheck do
18     url :url
19     regex(%r{/v?(\d+(?:\.\d+)+)/KaTrainOSX\.(?:dmg|pkg)$}i)
20     strategy :github_releases do |json, regex|
21       json.map do |release|
22         next if release["draft"] || release["prerelease"]
24         release["assets"]&.map do |asset|
25           match = asset["browser_download_url"]&.match(regex)
26           next if match.blank?
28           match[1]
29         end
30       end.flatten
31     end
32   end
34   app "KaTrain.app"
36   zap trash: "~/.katrain"
38   caveats do
39     requires_rosetta
40   end
41 end