cask "mps" do arch arm: "macos-aarch64", intel: "macos" version "2025.1,251.23774.423" sha256 arm: "cb2aaa6311252a655ef55f813d3dff78890c2a10cf0aeff885018c316390486b", intel: "1ddae8569c8a96beeb5e85d20f1eed9115ace532a1154b5624f526cb49ddeaa8" 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| version = release["version"] build = release["build"] next if version.blank? || build.blank? "#{version},#{build}" end end end no_autobump! because: :requires_manual_review auto_updates true depends_on macos: ">= :high_sierra" app "MPS.app" # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809) shimscript = "#{staged_path}/mps.wrapper.sh" binary shimscript, target: "mps" preflight do File.write shimscript, <<~EOS #!/bin/sh exec '#{appdir}/MPS.app/Contents/MacOS/mps' "$@" EOS 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