-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintellij-idea222.rb
49 lines (41 loc) · 1.63 KB
/
intellij-idea222.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cask "intellij-idea222" do
arch = Hardware::CPU.intel? ? "" : "-aarch64"
version "2022.1.4,221.6008.13"
if Hardware::CPU.intel?
sha256 "c30c823d24a79eefc4a0f8e9c497c5e4e984cc44e9bcd011dae2a593926b46ea"
else
sha256 "d324ee0ea7f72855826921eaa689b9a53b6038d752b6e5f7f895f3bf0d727d3b"
end
url "https://download.jetbrains.com/idea/ideaIU-#{version.csv.first}#{arch}.dmg"
name "IntelliJ IDEA Ultimate"
desc "Java IDE by JetBrains"
homepage "https://www.jetbrains.com/idea/"
livecheck do
url "https://data.services.jetbrains.com/products/releases?code=IIU&latest=true&type=release"
strategy :page_match do |page|
JSON.parse(page)["IIU"].map do |release|
"#{release["version"]},#{release["build"]}"
end
end
end
auto_updates true
depends_on macos: ">= :high_sierra"
app "IntelliJ IDEA.app"
uninstall_postflight do
ENV["PATH"].split(File::PATH_SEPARATOR).map { |path| File.join(path, "idea") }.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/IntelliJIdea#{version.major_minor}",
"~/Library/Caches/JetBrains/IntelliJIdea#{version.major_minor}",
"~/Library/Logs/JetBrains/IntelliJIdea#{version.major_minor}",
"~/Library/Preferences/com.jetbrains.intellij.plist",
"~/Library/Preferences/IntelliJIdea#{version.major_minor}",
"~/Library/Preferences/jetbrains.idea.*.plist",
"~/Library/Saved Application State/com.jetbrains.intellij.savedState",
]
end