1 cask "keepassxc@snapshot" do
3 sha256 "6e04fe12dc0c3a68a5d7d3341ad4e296dfd7166bf46b830b22bb9ec27a511bfc"
5 url "https://snapshot.keepassxc.org/build-#{version.csv.second}/KeePassXC-#{version.csv.first}-snapshot.dmg"
7 desc "Password manager app"
8 homepage "https://keepassxc.org/"
11 url "https://snapshot.keepassxc.org/"
12 regex(/href=.*?KeePassXC[._-]v?(\d+(?:\.\d+)+)-snapshot\.dmg/i)
13 strategy :page_match do |page, regex|
14 # Identify build numbers from directories like `build-123456`
15 newest_build = page.scan(%r{href=["']?build[._-]v?(\d+(?:\.\d+)*)/?["' >]}i)
19 next if newest_build.blank?
21 # Fetch the directory listing page for newest build
22 build_response = Homebrew::Livecheck::Strategy.page_content("https://snapshot.keepassxc.org/build-#{newest_build}/")
23 next if (build_page = build_response[:content]).blank?
25 match = build_page.match(regex)
28 "#{match[1]},#{newest_build}"
32 deprecate! date: "2025-05-01", because: :unsigned
35 binary "#{appdir}/KeePassXC.app/Contents/MacOS/keepassxc-cli"
37 zap trash: "~/.keepassxc"