cask "codebuddy-cn" do arch arm: "arm64", intel: "x64" version "4.12.2.41207131,425ab70e" sha256 arm: "acbf4321ca93fd9d3a3982d8cde76444235232f1d73362d1ddb1ba09d014c96c", intel: "00a7af8c54fbdd1432d59ce78b61198bb7e0cb0b81dfa48fed151f2ad3f3e765" url "https://acc-1258344699.cos.accelerate.myqcloud.com/aiide/darwin-#{arch}/CodeBuddy-darwin-#{arch}-#{version.csv.first}-#{version.csv.second}-cn.zip" name "CodeBuddy CN" desc "AI-powered adaptive IDE (Chinese version)" homepage "https://copilot.tencent.com/ide/" livecheck do url "https://copilot.tencent.com/v2/update?platform=ide-darwin-#{arch}&version=1.0.0&x-machine-id=default" regex(%r{/CodeBuddy[._-]darwin[._-]#{arch}[._-]v?(\d+(?:\.\d+)+)-(\h+)[._-]cn\.zip}i) strategy :json do |json, regex| match = json["url"]&.match(regex) next if match.blank? "#{match[1]},#{match[2]}" end end auto_updates true depends_on :macos app "CodeBuddy CN.app" zap trash: [ "~/.codebuddycn", "~/Library/Application Support/CodeBuddy CN", "~/Library/Application Support/CodeBuddyExtension", "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.tencent.codebuddycn.sfl*", "~/Library/Application Support/com.tencent.codebuddycn*", "~/Library/Caches/com.tencent.codebuddycn", "~/Library/Caches/com.tencent.codebuddycn.ShipIt", "~/Library/HTTPStorages/com.tencent.codebuddycn*", "~/Library/Preferences/com.tencent.codebuddycn.helper.plist", "~/Library/Preferences/com.tencent.codebuddycn.plist", ] end