Merge pull request #155219 from cbguder/rustrover

rustrover: new cask
This commit is contained in:
Razvan Azamfirei 2023-09-14 18:35:53 -04:00 committed by GitHub
commit 92de71df34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 43 additions and 0 deletions

43
Casks/r/rustrover.rb Normal file
View File

@ -0,0 +1,43 @@
cask "rustrover" do
arch arm: "-aarch64"
version "2023.2,232.9921.46"
sha256 arm: "7f01fef11d89c6c6c870a79007607babde40f7a958b7103d1028aa760ed713b7",
intel: "4c7193acf07f44b91512d8b4c04c88068b8599e76150a81dfd728046910a0929"
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"
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
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