mirror of
https://github.com/wavetermdev/homebrew-cask.git
synced 2026-08-05 13:43:24 -07:00
cockatrice: rebuild
Fix livecheck Closes #133425. Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
This commit is contained in:
+13
-5
@@ -23,12 +23,20 @@ cask "cockatrice" do
|
||||
homepage "https://cockatrice.github.io/"
|
||||
|
||||
livecheck do
|
||||
url :url
|
||||
strategy :github_latest do |page|
|
||||
match = page.match(
|
||||
%r{href=".*?/(\d+(?:-\d+)+)-Release-(\d+(?:\.\d+)+)/Cockatrice-([^/]+)-\2-macOS-[.\w]*\.dmg"}i,
|
||||
url "https://github.com/Cockatrice/Cockatrice/releases/latest/"
|
||||
regex(%r{href=".*?/(\d+(?:-\d+)+)-Release-(\d+(?:\.\d+)+)/Cockatrice-([^/]+)-\2-macOS-[.\w]*\.dmg"}i)
|
||||
strategy :header_match do |headers, regex|
|
||||
next if headers["location"].blank?
|
||||
|
||||
# Identify the latest tag from the response's `location` header
|
||||
latest_tag = File.basename(headers["location"])
|
||||
next if latest_tag.blank?
|
||||
|
||||
# Fetch the assets list HTML for the latest tag and match within it
|
||||
assets_page = Homebrew::Livecheck::Strategy.page_content(
|
||||
@url.sub(%r{/releases/?.+}, "/releases/expanded_assets/#{latest_tag}"),
|
||||
)
|
||||
"#{match[2]},#{match[1]},#{match[3]}"
|
||||
assets_page[:content]&.scan(regex)&.map { |match| "#{match[1]},#{match[0]},#{match[2]}" }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user