homebrew-cask/Casks/r/rustrover.rb

44 lines
1.5 KiB
Ruby
Raw Normal View History

2023-09-15 02:45:41 +08:00
cask "rustrover" do
arch arm: "-aarch64"
2023-12-19 22:58:22 +08:00
version "2023.3,233.11799.306"
sha256 arm: "e80a287edb1982e307117c18428a9bf0a0aacae4d14cb27f56f029122329266a",
intel: "51131cf92383e1e9b345aed8ac99189385ecf9708dd0d4abc07c6c7925a129fe"
2023-09-15 02:45:41 +08:00
url "https://download.jetbrains.com/rustrover/RustRover-#{version.csv.second}#{arch}.dmg"
name "RustRover"
desc "Rust IDE"
homepage "https://www.jetbrains.com/rust/"
livecheck do
url "https://data.services.jetbrains.com/products/releases?code=RR&latest=true&type=eap"
strategy :json do |json|
json["RR"].map do |release|
"#{release["version"]},#{release["build"]}"
end
end
end
auto_updates true
depends_on macos: ">= :catalina"
2023-09-15 06:25:19 +08:00
app "RustRover #{version.before_comma} EAP.app", target: "RustRover.app"
uninstall_postflight do
ENV["PATH"].split(File::PATH_SEPARATOR).map { |path| File.join(path, "rover") }.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
2023-09-15 02:45:41 +08:00
zap trash: [
"~/Library/Application Support/JetBrains/RustRover#{version.major_minor}",
"~/Library/Caches/JetBrains/RustRover#{version.major_minor}",
"~/Library/Logs/JetBrains/RustRover#{version.major_minor}",
"~/Library/Preferences/com.jetbrains.rustrover-EAP.plist",
"~/Library/Saved Application State/com.jetbrains.rustrover-EAP.SavedState",
]
end