excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / k / kaleidoscope.rb
blobba19e692456b5601221b9596b701a9ad26c2ddf4
1 cask "kaleidoscope" do
2   version "5.2.1,7100"
3   sha256 "9cba678dc4330fbae3225fce65809fd2bea17eb4acee86b3ed6e1590d301db95"
5   url "https://updates.kaleidoscope.app/v#{version.major}/prod/Kaleidoscope-#{version.csv.first}-#{version.csv.second}.app.zip"
6   name "Kaleidoscope"
7   desc "Spot and merge differences in text and image files or folders"
8   homepage "https://kaleidoscope.app/"
10   livecheck do
11     url "https://updates.kaleidoscope.app/v#{version.major}/prod/appcast"
12     regex(/Kaleidoscope[._-]v?(\d+(?:\.\d+)+)[._-](\d+)\.app\.zip/i)
13     strategy :sparkle do |item, regex|
14       match = item.url.match(regex)
15       next if match.blank?
17       "#{match[1]},#{match[2]}"
18     end
19   end
21   auto_updates true
22   conflicts_with cask: %w[
23     kaleidoscope@2
24     kaleidoscope@3
25     ksdiff
26   ]
27   depends_on macos: ">= :ventura"
29   app "Kaleidoscope.app"
31   postflight do
32     contents = "#{appdir}/Kaleidoscope.app/Contents"
33     system_command "#{contents}/Resources/Integration/scripts/install_ksdiff",
34                    args: ["#{contents}/MacOS", "#{HOMEBREW_PREFIX}/bin"]
35   end
37   uninstall quit:    "app.kaleidoscope.v#{version.major}",
38             pkgutil: "app.kaleidoscope.uninstall_ksdiff"
40   zap trash: [
41     "~/Library/Application Support/app.kaleidoscope.v*",
42     "~/Library/Application Support/com.blackpixel.kaleidoscope",
43     "~/Library/Application Support/Kaleidoscope",
44     "~/Library/Caches/app.kaleidoscope.v*",
45     "~/Library/Caches/com.blackpixel.kaleidoscope",
46     "~/Library/Caches/com.plausiblelabs.crashreporter.data/com.blackpixel.kaleidoscope",
47     "~/Library/Preferences/app.kaleidoscope.v*.plist",
48     "~/Library/Preferences/com.blackpixel.kaleidoscope.plist",
49     "~/Library/Saved Application State/app.kaleidoscope.v*.savedState",
50     "~/Library/Saved Application State/com.blackpixel.kaleidoscope.savedState",
51     "~/Library/WebKit/app.kaleidoscope.v*",
52   ]
53 end