cask "cursor" do arch arm: "arm64", intel: "x64" version "0.42.5,24111460bf2loz1" sha256 arm: "de8626239fc89e65e6501ec4c4edeb4ea31d82dc85ee4fb6f147f66071155eaf", intel: "d319622ec4bd358ea8fa6e92178c6273d288cfd20c94bac66de98342d671ac02" url "https://download.todesktop.com/230313mzl4w4u92/Cursor%20#{version.csv.first}%20-%20Build%20#{version.csv.second}-#{arch}-mac.zip", verified: "download.todesktop.com/230313mzl4w4u92/" name "Cursor" desc "Write, edit, and chat about your code with AI" homepage "https://cursor.sh/" livecheck do url "https://download.todesktop.com/230313mzl4w4u92/latest-mac.yml" regex(/Build[ ._-]([^-]+)[._-]/i) strategy :electron_builder do |yaml, regex| yaml["files"]&.map do |item| match = item["url"]&.match(regex) next if match.blank? "#{yaml["version"]},#{match[1]}" end end end auto_updates true depends_on macos: ">= :catalina" app "Cursor.app" binary "#{appdir}/Cursor.app/Contents/Resources/app/bin/code", target: "cursor" zap trash: [ "~/.cursor", "~/.cursor-tutor", "~/Library/Application Support/Caches/cursor-updater", "~/Library/Application Support/Cursor", "~/Library/Caches/com.todesktop.*", "~/Library/Caches/com.todesktop.*.ShipIt", "~/Library/HTTPStorages/com.todesktop.*", "~/Library/Logs/Cursor", "~/Library/Preferences/ByHost/com.todesktop.*.ShipIt.*.plist", "~/Library/Preferences/com.todesktop.*.plist", "~/Library/Saved Application State/com.todesktop.*.savedState", "~/Library/Saved Application State/todesktop.com.ToDesktop-Installer.savedState", ] end