44 lines
1.5 KiB
Ruby
44 lines
1.5 KiB
Ruby
cask "mps" do
|
|
arch arm: "macos-aarch64", intel: "macos"
|
|
|
|
version "2022.2,222.3345.1295"
|
|
sha256 arm: "bdc83d9c7a3430cc2b0b0361a9e4eab82e951bfe87f0e4754106d09850947077",
|
|
intel: "4e36c60d281596c220287ab2191165be37ef01c3c54ab5f5e4e535c8b81bc754"
|
|
|
|
url "https://download.jetbrains.com/mps/#{version.major_minor}/MPS-#{version.csv.first}-#{arch}.dmg"
|
|
name "JetBrains MPS"
|
|
desc "Create your own domain-specific language"
|
|
homepage "https://www.jetbrains.com/mps/"
|
|
|
|
livecheck do
|
|
url "https://data.services.jetbrains.com/products/releases?code=MPS&latest=true&type=release"
|
|
strategy :json do |json|
|
|
json["MPS"].map do |release|
|
|
"#{release["version"]},#{release["build"]}"
|
|
end
|
|
end
|
|
end
|
|
|
|
auto_updates true
|
|
depends_on macos: ">= :high_sierra"
|
|
|
|
app "MPS #{version.major_minor}.app"
|
|
|
|
uninstall_postflight do
|
|
ENV["PATH"].split(File::PATH_SEPARATOR).map { |path| File.join(path, "mps") }.each do |path|
|
|
if File.readable?(path) &&
|
|
File.readlines(path).grep(/# see com.intellij.idea.SocketLock for the server side of this interface/).any?
|
|
File.delete(path)
|
|
end
|
|
end
|
|
end
|
|
|
|
zap trash: [
|
|
"~/Library/Application Support/MPS#{version.csv.first.major_minor}",
|
|
"~/Library/Caches/MPS#{version.csv.first.major_minor}",
|
|
"~/Library/Logs/MPS#{version.csv.first.major_minor}",
|
|
"~/Library/Preferences/MPS#{version.csv.first.major_minor}",
|
|
"~/MPSSamples.#{version.csv.first.major_minor}",
|
|
]
|
|
end
|