Skip to content

Commit

Permalink
Merge pull request #184658 from Homebrew/katrain-livecheck
Browse files Browse the repository at this point in the history
katrain: update livecheck
  • Loading branch information
bevanjkay committed Sep 8, 2024
2 parents 5ac7e30 + 0a45bdf commit 8867df5
Showing 1 changed file with 20 additions and 0 deletions.
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

0 comments on commit 8867df5

Please sign in to comment.