cask "pycharm" do arch arm: "-aarch64" version "2025.1.3,251.26927.74" sha256 arm: "2998906836db6b28f1bd25f9e357cd35a60782d246a7a8b7fc4e4be1d4cf6730", intel: "60514c4e7664286a28c0e72f9fd7b402a519d7336dc77cc88a5d28c12c3bb1e8" url "https://download.jetbrains.com/python/pycharm-professional-#{version.csv.first}#{arch}.dmg" name "PyCharm" name "PyCharm Professional" desc "IDE for professional Python development" homepage "https://www.jetbrains.com/pycharm/" livecheck do url "https://data.services.jetbrains.com/products/releases?code=PCP&latest=true&type=release" strategy :json do |json| json["PCP"]&.map do |release| version = release["version"] build = release["build"] next if version.blank? || build.blank? "#{version},#{build}" end end end auto_updates true depends_on macos: ">= :high_sierra" app "PyCharm.app" # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809) shimscript = "#{staged_path}/pycharm.wrapper.sh" binary shimscript, target: "pycharm" preflight do File.write shimscript, <<~EOS #!/bin/sh exec '#{appdir}/PyCharm.app/Contents/MacOS/pycharm' "$@" EOS end zap trash: [ "~/Library/Application Support/JetBrains/PyCharm#{version.major_minor}", "~/Library/Application Support/PyCharm#{version.major_minor}", "~/Library/Caches/JetBrains/PyCharm#{version.major_minor}", "~/Library/Logs/JetBrains/PyCharm#{version.major_minor}", "~/Library/Preferences/com.jetbrains.pycharm.plist", "~/Library/Preferences/jetbrains.pycharm.*.plist", "~/Library/Preferences/PyCharm#{version.major_minor}", "~/Library/Saved Application State/com.jetbrains.pycharm.savedState", ] end