Skip to content

Commit

Permalink
vscodium: add livecheck
Browse files Browse the repository at this point in the history
By default, livecheck checks the Git tags for `vscodium` and it
correctly returns 1.89.1.24130 as the latest version but the releases
after 1.88.1.24104 haven't provided assets for macOS because of a
temporary technical issue.

This adds a `GithubReleases` `livecheck` block to restrict matching
to releases with dmg files. We should be able to switch to
`strategy :github_latest` once upstream provides dmg files in
subsequent releases but this addresses the issue for the moment.
  • Loading branch information
samford committed May 17, 2024
1 parent 91fe575 commit 155f056
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Casks/v/vscodium.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@
desc "Binary releases of VS Code without MS branding/telemetry/licensing"
homepage "https://github.com/VSCodium/vscodium"

# Not every GitHub release provides a file for macOS, so we check multiple
# recent releases instead of only the "latest" release. NOTE: We should be
# able to use `strategy :github_latest` when subsequent releases provide
# files for macOS again.
livecheck do
url :url
regex(/^VScodium[._-]#{arch}[._-]v?(\d+(?:\.\d+)+)\.(?: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["name"]&.match(regex)
next if match.blank?

match[1]
end
end.flatten
end
end

auto_updates true
depends_on macos: ">= :high_sierra"

Expand Down

0 comments on commit 155f056

Please sign in to comment.