Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

katrain: update livecheck #184658

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Casks/k/katrain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@
desc "Tool for analyzing games and playing go with AI feedback from KataGo"
homepage "https://github.com/sanderland/katrain"

# Most recent release doesn't provide a file forr macOS, so we check multiple
# recent releases instead of only the "latest" release. NOTE: We should be
# able to remove this next release when upstream provides a file for macOS again.
livecheck do
url :url
regex(%r{/v?(\d+(?:\.\d+)+)/KaTrainOSX\.(?:dmg|pkg)$}i)
strategy :github_releases do |json, regex|
json.map do |release|
next if release["draft"] || release["prerelease"]

release["assets"]&.map do |asset|
match = asset["browser_download_url"]&.match(regex)
next if match.blank?

match[1]
end
end.flatten
end
end

app "KaTrain.app"

zap trash: "~/.katrain"
Expand Down
Loading