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

snes9x: update livecheck #184643

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
23 changes: 23 additions & 0 deletions Casks/s/snes9x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,29 @@
desc "Video game console emulator"
homepage "https://www.snes9x.com/"

# Releases sometimes don't have a macOS build, so we check multiple
# recent releases instead of only the "latest" release. NOTE: We should be
# able to use `strategy :github_latest` or drop livecheck altogether
# when subsequent releases provide files for macOS again.
livecheck do
url :url
regex(/^snes9x[._-]v?(\d+(?:\.\d+)+)[._-]Mac\.zip$/i)
strategy :github_releases do |json, regex|
json.map do |release|
next if release["draft"] || release["prerelease"]

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

match[1]
end
end.flatten
end
end

depends_on macos: ">= :sierra"

app "Snes9x.app"

zap trash: [
Expand Down
Loading