44 lines
1.4 KiB
Ruby
44 lines
1.4 KiB
Ruby
cask "phpstorm" do
|
|
arch arm: "-aarch64"
|
|
|
|
version "2022.3.3,223.8836.42"
|
|
sha256 arm: "23ba3a7ff84216b945327241be759429040bd09bc4269a01b77a2e3745c66132",
|
|
intel: "79f5857f95452a6f66ba4ddbfd4445290449f21b90e6fd37e6118ac17cc052ed"
|
|
|
|
url "https://download.jetbrains.com/webide/PhpStorm-#{version.csv.first}#{arch}.dmg"
|
|
name "JetBrains PhpStorm"
|
|
desc "PHP IDE by JetBrains"
|
|
homepage "https://www.jetbrains.com/phpstorm/"
|
|
|
|
livecheck do
|
|
url "https://data.services.jetbrains.com/products/releases?code=PS&latest=true&type=release"
|
|
strategy :json do |json|
|
|
json["PS"].map do |release|
|
|
"#{release["version"]},#{release["build"]}"
|
|
end
|
|
end
|
|
end
|
|
|
|
auto_updates true
|
|
depends_on macos: ">= :high_sierra"
|
|
|
|
app "PhpStorm.app"
|
|
|
|
uninstall_postflight do
|
|
ENV["PATH"].split(File::PATH_SEPARATOR).map { |path| File.join(path, "pstorm") }.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/PhpStorm#{version.major_minor}",
|
|
"~/Library/Caches/PhpStorm#{version.major_minor}",
|
|
"~/Library/Logs/PhpStorm#{version.major_minor}",
|
|
"~/Library/Preferences/jetbrains.phpstorm.*.plist",
|
|
"~/Library/Preferences/PhpStorm#{version.major_minor}",
|
|
]
|
|
end
|