Skip to content

Commit

Permalink
Merge pull request #174163 from Homebrew/vscodium-add-livecheck
Browse files Browse the repository at this point in the history
vscodium: add livecheck
  • Loading branch information
krehel authored May 17, 2024
2 parents 1bed3b8 + 155f056 commit 7ed1520
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 7ed1520

Please sign in to comment.