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