excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / s / sublime-text@dev.rb
blobdfb850e92c74b8f0144fdfcdb1339d9c920a6cea
1 cask "sublime-text@dev" do
2   # NOTE: The first digit of the build number is the major version.
3   version "4184"
4   sha256 "a8686a346dd77f498f287266334abd500e749ecca6860ea4b1d6bec6ad37618c"
6   url "https://download.sublimetext.com/sublime_text_build_#{version}_mac.zip"
7   name "Sublime Text"
8   desc "Text editor for code, markup and prose"
9   homepage "https://www.sublimetext.com/dev"
11   livecheck do
12     url "https://www.sublimetext.com/updates/#{version[0]}/dev_update_check"
13     strategy :json do |json|
14       json["latest_version"]&.to_s
15     end
16   end
18   auto_updates true
19   conflicts_with cask: "sublime-text"
21   app "Sublime Text.app"
22   binary "#{appdir}/Sublime Text.app/Contents/SharedSupport/bin/subl"
24   uninstall quit: "com.sublimetext.#{version[0]}"
26   # Sublime Text 4 uses `Sublime Text 3` and `com.sublimetext.3` dirs if they exist
27   # Otherwise, it creates `Sublime Text` and `com.sublimetext.4`
28   # More info: https://www.sublimetext.com/docs/side_by_side.html
29   zap trash: [
30     "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.sublimetext.#{version[0]}.sfl*",
31     "~/Library/Application Support/Sublime Text (Safe Mode)",
32     "~/Library/Application Support/Sublime Text 3",
33     "~/Library/Application Support/Sublime Text",
34     "~/Library/Caches/com.sublimetext.#{version[0]}",
35     "~/Library/Caches/com.sublimetext.3",
36     "~/Library/Preferences/com.sublimetext.#{version[0]}.plist",
37     "~/Library/Preferences/com.sublimetext.3.plist",
38     "~/Library/Saved Application State/com.sublimetext.#{version[0]}.savedState",
39     "~/Library/Saved Application State/com.sublimetext.3.savedState",
40   ]
41 end