cask "zspace" do arch arm: "arm64", intel: "x64" folder = on_arch_conditional arm: "ARM" on_arm do version "2.11.2024100601,1728354108,100611" sha256 "9596d0c30fb501ddd558515814f89a064f3547907fe56d8659d72cf437633e79" end on_intel do version "2.11.2024092601,1727349239,092610" sha256 "457fe471a886eaa444e75ca04a8624716dc4ceecdf213353e191f19d924286cc" end url "https://update.zenithspace.net/app/APP_ZSPACE_DESKTOP_MAC#{folder}/V#{version.csv.first}/zspace/#{version.csv.second}/zspace_mac_#{arch}_#{version.csv.first}_#{version.csv.third}.dmg", verified: "update.zenithspace.net/app/" name "zspace" name "极空间" desc "NAS Client" homepage "https://www.zspace.cn/" livecheck do url "https://upgrade.zenithspace.net/upgrade_server/v2/check_upgrade?app_id=APP_ZSPACE_DESKTOP_MAC#{folder}&app_version=V0.0.0&nas_id=&plat=app&channel=zspace&skip_app_sync_upgrade=1" regex(%r{v?(\d+(?:\.\d+)+)/zspace/(\d+)/zspace[._-]mac[._-]#{arch}[._-](?:\d+(?:\.\d+)+)[._-](\d+)\.dmg}i) strategy :json do |json, regex| json.dig("data", "download_url")&.scan(regex)&.map { |match| "#{match[0]},#{match[1]},#{match[2]}" } end end auto_updates true app "极空间.app" zap trash: [ "~/Library/Application Support/zspace", "~/Library/Logs/zspace", "~/Library/Preferences/com.zentraedi.zspaceMacApp.plist", ] end