Merge pull request #200927 from Homebrew/bump-zed-0.172.10
[Homebrew/homebrew-cask.git] / Casks / w / wetype.rb
blob7720f0c86ab7d3592c65c68e5c462901565c6859
1 cask "wetype" do
2   version "1.2.8,452"
3   sha256 "feec904968013103f556f161b7792ae2a110775118c9630a0df7dcf719b69c69"
5   url "https://download.z.weixin.qq.com/app/mac/#{version.csv.first}/WeTypeInstaller_#{version.csv.first}_#{version.csv.second}.zip"
6   name "WeType"
7   name "微信输入法"
8   desc "Text input app from WeChat team for Chinese users"
9   homepage "https://z.weixin.qq.com/"
11   livecheck do
12     url "https://z.weixin.qq.com/web/api/app_info"
13     regex(/WeTypeInstaller[._-]v?(\d+(?:.\d+)+)[._-](\d+)\.zip/i)
14     strategy :json do |json, regex|
15       match = json.dig("data", "mac", "download_link")&.match(regex)
16       next if match.blank?
18       "#{match[1]},#{match[2]}"
19     end
20   end
22   auto_updates true
23   depends_on macos: ">= :catalina"
25   installer manual: "WeTypeInstaller_#{version.csv.first}_#{version.csv.second}.app"
27   uninstall delete: "/Library/Input Methods/WeType.app"
29   zap trash: [
30     "~/Library/Application Support/WeType",
31     "~/Library/Caches/com.tencent.inputmethod.wetype",
32     "~/Library/Caches/WeType",
33     "~/Library/HTTPStorages/com.tencent.inputmethod.wetype",
34     "~/Library/Preferences/com.tencent.inputmethod.wetype.plist",
35   ]
36 end