excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / l / logitech-g-hub.rb
blobedee0bfabbf7029711a80811262a05d7bfe56530
1 cask "logitech-g-hub" do
2   version "2024.8.641856"
3   sha256 :no_check
5   url "https://download01.logi.com/web/ftp/pub/techsupport/gaming/lghub_installer.zip",
6       verified: "download01.logi.com/"
7   name "Logitech G HUB"
8   desc "Support for Logitech G gear"
9   homepage "https://www.logitechg.com/en-us/innovation/g-hub.html"
11   livecheck do
12     url "https://support.logi.com/api/v2/help_center/en-us/articles.json?label_names=webcontent=productdownload,websoftware=eee3033c-8e0b-11e9-8db1-d7e925481d4d"
13     regex(/Software\s+Version:.*?(\d+(?:\.\d+)+)/i)
14     strategy :json do |json, regex|
15       json["articles"]&.map do |article|
16         match = article["body"]&.match(regex)
17         next if match.blank?
19         match[1]
20       end
21     end
22   end
24   auto_updates true
26   installer script: {
27     executable: "lghub_installer.app/Contents/MacOS/lghub_installer",
28     args:       ["--silent"],
29     sudo:       true,
30   }
32   postflight do
33     set_ownership   ["#{appdir}/lghub.app", "/Users/Shared/LGHUB"]
34     set_permissions "#{appdir}/lghub.app", "0755"
35   end
37   uninstall script: {
38               executable: "/Applications/lghub.app/Contents/MacOS/lghub_updater.app/Contents/MacOS/lghub_updater",
39               args:       ["--uninstall"],
40               sudo:       true,
41             },
42             delete: "/Applications/lghub.app",
43             trash:  "/Users/Shared/LGHUB"
45   zap trash: [
46     "~/Library/Application Support/lghub",
47     "~/Library/Caches/com.logi.ghub.installer",
48     "~/Library/Preferences/com.logi.ghub.plist",
49     "~/Library/Saved Application State/com.logi.ghub.savedState",
50   ]
51 end