homebrew-cask/Casks/v/vscodium.rb

51 lines
1.7 KiB
Ruby

cask "vscodium" do
arch arm: "arm64", intel: "x64"
version "1.90.1.24165"
sha256 arm: "edda34e9947f2a2ce119d52e4b06b5db0913106851b71be6f5e621b7b8e623eb",
intel: "ea3ea738dc4624d8df0b0e126ed752dcf83647f0fb2026b14dca6ff0d26d36d7"
url "https://github.com/VSCodium/vscodium/releases/download/#{version}/VSCodium.#{arch}.#{version}.dmg"
name "VSCodium"
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"
app "VSCodium.app"
binary "#{appdir}/VSCodium.app/Contents/Resources/app/bin/codium"
zap trash: [
"~/.vscode-oss",
"~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.vscodium.sfl*",
"~/Library/Application Support/VSCodium",
"~/Library/Caches/com.vscodium",
"~/Library/Caches/com.vscodium.ShipIt",
"~/Library/HTTPStorages/com.vscodium",
"~/Library/Preferences/com.vscodium*.plist",
"~/Library/Saved Application State/com.vscodium.savedState",
]
end