cask "postgres-unofficial" do version "2.7.9,12-13-14-15-16-17" sha256 "d7e6f3547ff4fef75cff8064286f100a2e0578aa0930f965f9827b67e2fb564f" url "https://github.com/PostgresApp/PostgresApp/releases/download/v#{version.csv.first}/Postgres-#{version.csv.first}-#{version.csv.second}.dmg", verified: "github.com/PostgresApp/PostgresApp/" name "Postgres" desc "App wrapper for Postgres" homepage "https://postgresapp.com/" livecheck do url :url regex(/^Postgres[._-]v?(\d+(?:\.\d+)+)[._-](\d+(?:-\d+)+)\.dmg$/i) strategy :github_latest do |json, regex| json["assets"]&.map do |asset| match = asset["name"]&.match(regex) next if match.blank? "#{match[1]},#{match[2]}" end end end auto_updates true depends_on macos: ">= :high_sierra" app "Postgres.app" uninstall launchctl: "com.postgresapp.Postgres#{version.major}LoginHelper", quit: [ "com.postgresapp.Postgres#{version.major}", "com.postgresapp.Postgres#{version.major}MenuHelper", ] zap trash: [ "~/Library/Application Support/Postgres", "~/Library/Caches/com.postgresapp.Postgres#{version.major}", "~/Library/Cookies/com.postgresapp.Postgres#{version.major}.binarycookies", "~/Library/Preferences/com.postgresapp.Postgres#{version.major}.plist", ] end