cask "multiviewer-for-f1" do # NOTE: "1" is not a version number, but an intrinsic part of the product name arch arm: "arm64", intel: "x64" on_arm do version "1.36.2,203624185" sha256 "285a64f18e2343074a8a0eb137d5a19d76f5af227c644b8caafbbc3fff10c6b9" end on_intel do version "1.36.2,203626186" sha256 "60f19e1f3d4cfca7c5f8b2fde7d2cec465d74235d48efd7d878e1ae7cedb85ea" end url "https://releases.multiviewer.app/download/#{version.csv.second}/MultiViewer.for.F1-#{version.csv.first}-#{arch}.dmg" name "MultiViewer for F1" desc "Unofficial desktop client for F1TV" homepage "https://multiviewer.app/" livecheck do url "https://api.multiviewer.dev/api/v1/releases/latest" regex(%r{/([^/]+?)/MultiViewer[._-]for[._-]F1[._-]v?(\d+(?:\.\d+)+)[._-]#{arch}\.dmg}i) strategy :json do |json, regex| json["downloads"]&.flat_map do |item| match = item["url"]&.match(regex) next if match.blank? "#{match[2]},#{match[1]}" end end end auto_updates true app "MultiViewer for F1.app" zap trash: [ "~/Library/Application Support/MultiViewer for F1", "~/Library/Caches/com.electron.multiviewer-for-f1", "~/Library/Caches/com.electron.multiviewer-for-f1.ShipIt", "~/Library/HTTPStorages/com.electron.multiviewer-for-f1", "~/Library/Preferences/com.electron.multiviewer-for-f1.plist", "~/Library/Saved Application State/com.electron.multiviewer-for-f1.savedState", ] end