cask "forkgram-telegram" do arch arm: "arm64", intel: "x86" version "5.8.1" sha256 arm: "c828ca93fbf71f9595de3befeed92206368f6f1bb280b788f6038ec4c64f5f28", intel: "c45d32a78f4d1ec38312adff704373357359cb920b412ad420b7f5cad6245f44" url "https://github.com/Forkgram/tdesktop/releases/download/v#{version}/Forkgram.macOS.no.auto-update_#{arch}.zip" name "Forkgram" desc "Fork of Telegram Desktop" homepage "https://github.com/Forkgram/" # 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(/^v?(\d+(?:\.\d+)+)$/i) strategy :github_releases do |json, regex| file_regex = /^Forkgram[._-]macOS[._-].*?#{arch}\.zip$/i json.map do |release| next if release["draft"] || release["prerelease"] next unless release["assets"]&.any? { |asset| asset["name"]&.match?(file_regex) } match = release["tag_name"]&.match(regex) next if match.blank? match[1] end end end # Renamed to avoid conflict with telegram app "Telegram.app", target: "Forkgram.app" zap trash: "~/Library/Application Support/Forkgram Desktop" end