homebrew-cask/Casks/p/polkadot-js.rb

37 lines
1.1 KiB
Ruby

cask "polkadot-js" do
version "0.132.1"
sha256 "4521d91f2ee9bf2df35102ca91bcddba1d46f71dd1901b9dd35725159ee07358"
url "https://github.com/polkadot-js/apps/releases/download/v#{version}/Polkadot-JS-Apps-mac-#{version}.dmg",
verified: "github.com/polkadot-js/apps/"
name "polkadot{.js}"
desc "Portal into the Polkadot and Substrate networks"
homepage "https://polkadot.js.org/"
# Not every GitHub release provides a file for macOS, so we check multiple
# recent releases instead of only the "latest" release.
livecheck do
url :url
regex(/^Polkadot[._-]JS[._-]Apps[._-]mac[._-](\d+(?:\.\d+)*)\.(?:dmg|pkg|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
app "Polkadot-JS Apps.app"
zap trash: [
"~/Library/Preferences/com.polkadotjs.polkadotjs-apps.plist",
"~/Library/Saved Application State/com.polkadotjs.polkadotjs-apps.savedState",
]
end