Skip to content

Commit

Permalink
Merge pull request #132574 from samford/v8-update-livecheck
Browse files Browse the repository at this point in the history
v8: update livecheck
  • Loading branch information
BrewTestBot authored Jun 1, 2023
2 parents fcd86e4 + 198bd03 commit 359b15c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Formula/v8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@ class V8 < Formula
license "BSD-3-Clause"

livecheck do
url "https://omahaproxy.appspot.com/all.json?os=mac&channel=stable"
regex(/"v8_version": "v?(\d+(?:\.\d+)+)"/i)
url "https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Mac"
regex(/(\d+\.\d+\.\d+\.\d+)/i)
strategy :json do |json, regex|
# Find the v8 commit hash for the newest Chromium release version
v8_hash = json.max_by { |item| Version.new(item["version"]) }.dig("hashes", "v8")
next if v8_hash.blank?

# Check the v8 commit page for version text
v8_page = Homebrew::Livecheck::Strategy.page_content(
"https://chromium.googlesource.com/v8/v8.git/+/#{v8_hash}",
)
v8_page[:content]&.scan(regex)&.map { |match| match[0] }
end
end

bottle do
Expand Down

0 comments on commit 359b15c

Please sign in to comment.