excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / n / nextcloud.rb
blob185ae69a230471c7402b01f44f18f5673261305f
1 cask "nextcloud" do
2   on_big_sur :or_older do
3     version "3.8.1"
4     sha256 "448647db0068ff9a2b669ff2f9d715a36b4e5e1af82e9849e57d9f7078d1bd2e"
6     livecheck do
7       skip "Legacy version"
8     end
9   end
10   on_monterey :or_newer do
11     version "3.15.0"
12     sha256 "8c12fe3c8abcf8368c44bf4c96808d2c44dd18d621d0235238b3724d3c9ad68c"
14     # Upstream publishes releases for multiple different minor versions and the
15     # "latest" release is sometimes a lower version. Until the "latest" release
16     # is reliably the highest version, we have to check multiple releases.
17     livecheck do
18       url :url
19       regex(/^Nextcloud[._-]v?(\d+(?:\.\d+)+)\.pkg$/i)
20       strategy :github_releases do |json, regex|
21         json.map do |release|
22           next if release["draft"] || release["prerelease"]
24           release["assets"]&.map do |asset|
25             match = asset["name"]&.match(regex)
26             next if match.blank?
28             match[1]
29           end
30         end.flatten
31       end
32     end
33   end
35   url "https://github.com/nextcloud-releases/desktop/releases/download/v#{version}/Nextcloud-#{version}.pkg",
36       verified: "github.com/nextcloud-releases/desktop/"
37   name "Nextcloud"
38   desc "Desktop sync client for Nextcloud software products"
39   homepage "https://nextcloud.com/"
41   auto_updates true
42   conflicts_with cask: "nextcloud-vfs"
43   depends_on macos: ">= :mojave"
45   pkg "Nextcloud-#{version}.pkg"
46   binary "/Applications/Nextcloud.app/Contents/MacOS/nextcloudcmd"
48   uninstall launchctl: "com.nextcloud.desktopclient",
49             quit:      "com.nextcloud.desktopclient",
50             pkgutil:   "com.nextcloud.desktopclient",
51             delete:    "/Applications/Nextcloud.app"
53   zap trash: [
54     "~/Library/Application Scripts/com.nextcloud.desktopclient.FinderSyncExt",
55     "~/Library/Application Support/Nextcloud",
56     "~/Library/Caches/Nextcloud",
57     "~/Library/Containers/com.nextcloud.desktopclient.FinderSyncExt",
58     "~/Library/Group Containers/com.nextcloud.desktopclient",
59     "~/Library/Preferences/com.nextcloud.desktopclient.plist",
60     "~/Library/Preferences/Nextcloud",
61   ]
62 end