excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / k / kaleidoscope@3.rb
bloba04c62285d5bee9407201222cd93f54388a0ea03
1 cask "kaleidoscope@3" do
2   version "3.9,2176"
3   sha256 "036eea0cfd11797a72e37aa41af3c3acf65f7d6e9d5d5f5945444d49e232b44e"
5   url "https://updates.kaleidoscope.app/v#{version.major}/prod/Kaleidoscope-#{version.csv.first}-#{version.csv.second}.app.zip"
6   name "Kaleidoscope v3"
7   desc "Spot and merge differences in text and image files or folders"
8   homepage "https://kaleidoscope.app/"
10   # Upstream also includes the newest version across all major versions, so we
11   # have to omit items with a different major version.
12   livecheck do
13     url "https://updates.kaleidoscope.app/v#{version.major}/prod/appcast"
14     regex(/Kaleidoscope[._-]v?(\d+(?:\.\d+)+)[._-](\d+)\.app\.zip/i)
15     strategy :sparkle do |items, regex|
16       items.map do |item|
17         next if item.short_version&.split(".")&.first != version.major
19         match = item.url.match(regex)
20         next if match.blank?
22         "#{match[1]},#{match[2]}"
23       end
24     end
25   end
27   auto_updates true
28   conflicts_with cask: %w[
29     kaleidoscope
30     kaleidoscope@2
31     ksdiff
32   ]
33   depends_on macos: ">= :big_sur"
35   app "Kaleidoscope.app"
37   postflight do
38     contents = "#{appdir}/Kaleidoscope.app/Contents"
39     system_command "#{contents}/Resources/Integration/scripts/install_ksdiff",
40                    args: ["#{contents}/MacOS", "#{HOMEBREW_PREFIX}/bin"]
41   end
43   uninstall quit:    "app.kaleidoscope.v#{version.major}",
44             pkgutil: "app.kaleidoscope.uninstall_ksdiff"
46   zap trash: [
47     "~/Library/Application Support/app.kaleidoscope.v*",
48     "~/Library/Application Support/com.blackpixel.kaleidoscope",
49     "~/Library/Application Support/Kaleidoscope",
50     "~/Library/Caches/app.kaleidoscope.v*",
51     "~/Library/Caches/com.blackpixel.kaleidoscope",
52     "~/Library/Caches/com.plausiblelabs.crashreporter.data/com.blackpixel.kaleidoscope",
53     "~/Library/Preferences/app.kaleidoscope.v*.plist",
54     "~/Library/Preferences/com.blackpixel.kaleidoscope.plist",
55     "~/Library/Saved Application State/app.kaleidoscope.v*.savedState",
56     "~/Library/Saved Application State/com.blackpixel.kaleidoscope.savedState",
57     "~/Library/WebKit/app.kaleidoscope.v*",
58   ]
59 end