cask "lobehub" do arch arm: "-arm64" os macos: "-mac" url_end = on_system_conditional macos: "zip", linux: "AppImage" version "2.2.20" sha256 arm: "dc97793605b4a81bc8480ad7879a4bbe1d36d2143908b44076b5847cf7c6433c", intel: "1edfbc502bc499abfe10b2b0e363af41389c3b8bfa9ebdcd949077a1d61129f3", x86_64_linux: "3bdda0e570bb156f74cb3944044daeb7b3eb3a5774ca50db3e2bcc2cc3cb473b" on_macos do depends_on macos: :ventura app "LobeHub.app" zap trash: [ "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.lobehub.lobehub-desktop-beta.sfl*", "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.lobehub.lobehub-desktop.sfl*", "~/Library/Application Support/LobeHub", "~/Library/Application Support/LobeHub-Beta", "~/Library/Logs/LobeHub", "~/Library/Logs/LobeHub-Beta", "~/Library/Preferences/com.lobehub.lobehub-desktop-beta.plist", "~/Library/Preferences/com.lobehub.lobehub-desktop.plist", "~/Library/Saved Application State/com.lobehub.lobehub-desktop.savedState", ] end on_linux do depends_on arch: :x86_64 app_image "LobeHub-#{version}.AppImage", target: "LobeHub.AppImage" zap trash: "~/.config/LobeHub" end url "https://github.com/lobehub/lobe-chat/releases/download/v#{version}/LobeHub-#{version}#{arch}#{os}.#{url_end}" name "LobeHub" desc "AI chat framework" homepage "https://github.com/lobehub/lobe-chat" livecheck do url :url regex(/LobeHub[._-]v?(\d+(?:\.\d+)+)#{arch}#{os}\.#{url_end}/i) strategy :github_latest do |json, regex| json["assets"]&.map do |asset| asset["browser_download_url"]&.[](regex, 1) end end end auto_updates true end