cask "companion-satellite" do arch arm: "arm64", intel: "x64" livecheck_arch = on_arch_conditional arm: "arm", intel: "intel" version "2.2.2,494,5cc11fe" sha256 arm: "f820c05680e20acc8f2019e79c02facc837e40ba4efd84f15641f6fbf5f3eee2", intel: "f31b4594c0e0ee46efa7971f308fd2fe6e66412a4cda84e477a98856bee557cc" url "https://s4.bitfocus.io/builds/companion-satellite/companion-satellite-#{arch}-#{version.csv.second}-#{version.csv.third}.dmg" name "Bitfocus Satellite" desc "Satellite connection client for Bitfocus Companion" homepage "https://bitfocus.io/companion-satellite" livecheck do url "https://api.bitfocus.io/v1/product/companion-satellite/packages?branch=stable&limit=150" regex(/companion[._-]satellite[._-]#{arch}[._-]v?(\d+(?:\.\d+)*)[._-](\h+)\.dmg/i) strategy :json do |json, regex| json["packages"]&.map do |package| next if package["target"] != "mac-#{livecheck_arch}" version = package["version"]&.tr("v", "") next if version.blank? match = package["uri"]&.match(regex) next if match.blank? "#{version},#{match[1]},#{match[2]}" end end end depends_on macos: ">= :big_sur" app "Companion Satellite.app" zap trash: [ "~/Library/Application Support/companion-satellite", "~/Library/Application Support/satellite", ] end