excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / s / start.rb
blob44ef7c753c395eb7654ddfdeb186160f395ef413
1 cask "start" do
2   arch arm: "arm", intel: "x86"
3   folder_arch = on_arch_conditional arm: "m1/"
4   livecheck_arch = on_arch_conditional arm: "-arm"
6   sha256 arm:   "4a1ed8919ae9b4cfd6860750d41fbdbe9ae3c17e61fd6de386f04f50df66ce85",
7          intel: "408353fb2485009628ced803edb1813d2dd4c470cef185c596f15e9a92146fc1"
9   on_arm do
10     version "0.301.19071-62"
11   end
12   on_intel do
13     version "0.301.19071-64"
14   end
16   url "https://imgcdn.start.qq.com/cdn/mac.client/installer/#{folder_arch}START-Installer-#{arch}-#{version}.dmg"
17   name "START"
18   name "腾讯云游戏"
19   desc "Tencent cloud gaming platform"
20   homepage "https://start.qq.com/"
22   livecheck do
23     url "https://api.start.qq.com/cfg/get?biztypes=macos-update-info#{livecheck_arch}"
24     regex(/START-Installer[._-]#{arch}[._-]v?(\d+(?:[.-]\d+)+)\.dmg/i)
25     strategy :json do |json, regex|
26       match = json.dig("configs", "macos-update-info#{livecheck_arch}", "value")&.match(regex)
27       next if match.blank?
29       match[1]
30     end
31   end
33   auto_updates true
34   depends_on macos: ">= :sierra"
36   app "START.app"
38   uninstall quit: "com.tencent.start.mac.Start"
40   zap trash: [
41     "~/Library/Caches/com.tencent.start.mac.Start",
42     "~/Library/Caches/com.tencent.start.mac.Start.STGame",
43     "~/Library/Group Containers/com.tencent.start.mac",
44     "~/Library/Preferences/com.tencent.start.mac.Start.plist",
45     "~/Library/Preferences/com.tencent.start.mac.Start.STGame.plist",
46   ]
47 end