cask "finch" do arch arm: "aarch64", intel: "x86_64" version "1.4.1" sha256 arm: "815a3898adff3eb5be303023e9c026816cd7a681557be7edcfb63772c32ec932", intel: "ddd9e9cb074c11b37d13a90993ae55d088aaa51514969c3613cc91fa66142646" url "https://github.com/runfinch/finch/releases/download/v#{version}/Finch-v#{version}-#{arch}.pkg" name "Finch" desc "Open source container development tool" homepage "https://github.com/runfinch/finch" # Not every GitHub release provides a file for macOS, so we check multiple # recent releases instead of only the "latest" release. livecheck do url :url regex(/^Finch[._-]v?(\d+(?:\.\d+)+)[._-]#{arch}\.(?:dmg|pkg|zip)$/i) strategy :github_releases do |json, regex| json.map do |release| next if release["draft"] || release["prerelease"] release["assets"]&.map do |asset| match = asset["name"]&.match(regex) next if match.blank? match[1] end end.flatten end end pkg "Finch-v#{version}-#{arch}.pkg" uninstall script: { executable: "/Applications/Finch/uninstall.sh", sudo: true, } zap trash: "~/.finch" end