cask "mixin" do version "1.13.0" sha256 "c79b125bf40c4492ec7d5bea503dc32363c45cbad58fc6da575323de96df682b" url "https://github.com/MixinNetwork/flutter-app/releases/download/v#{version}/mixin-#{version}.dmg" name "Mixin Messenger Desktop" desc "Cryptocurrency wallet" homepage "https://github.com/MixinNetwork/flutter-app" # 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(/^mixin[._-]v?(\d+(?:\.\d+)+)\.(?: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 auto_updates true app "Mixin.app" zap trash: [ "~/Library/Application Scripts/one.mixin.messenger.desktop", "~/Library/Application Support/one.mixin.messenger.desktop", "~/Library/Containers/one.mixin.messenger.desktop", "~/Library/Saved Application State/one.mixin.messenger.desktop.savedState", ] end