diff --git a/Casks/v/vscodium.rb b/Casks/v/vscodium.rb index 4154a813f8ad..88032c4d51a6 100644 --- a/Casks/v/vscodium.rb +++ b/Casks/v/vscodium.rb @@ -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"