diff --git a/Casks/i/intellij-idea-oss.rb b/Casks/i/intellij-idea-oss.rb new file mode 100644 index 0000000000000..180d848e48dd7 --- /dev/null +++ b/Casks/i/intellij-idea-oss.rb @@ -0,0 +1,37 @@ +cask "intellij-idea-oss" do + arch arm: "-aarch64" + + version "2026.1" + sha256 arm: "248cc39ae85ea176e9b4a5fc0e0f8f67eea2db42ba3d67d75e1a23c3597067b3", + intel: "2f04e7bf2666b059d9e1886d9415622bec06c884d9dca9eb131265de936c7cb5" + + url "https://github.com/JetBrains/intellij-community/releases/download/idea%2F#{version}/idea-#{version}#{arch}.dmg" + name "IntelliJ IDEA OSS" + desc "Open-source edition of IntelliJ IDEA" + homepage "https://github.com/JetBrains/intellij-community" + + livecheck do + url :url + regex(/^idea[._-](\d+(?:\.\d+)+)(?:[._-].*)?\.dmg$/i) + strategy :github_releases do |json, regex| + json.flat_map do |release| + next if release["draft"] || release["prerelease"] + + release["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + match[1] if match + end + end + end + end + + app "IntelliJ IDEA CE.app" + + zap trash: [ + "~/Library/Application Support/JetBrains/IdeaIC#{version.major_minor}", + "~/Library/Caches/JetBrains/IdeaIC#{version.major_minor}", + "~/Library/Logs/JetBrains/IdeaIC#{version.major_minor}", + "~/Library/Preferences/com.jetbrains.intellij.ce.plist", + "~/Library/Saved Application State/com.jetbrains.intellij.ce.savedState", + ] +end