s/stoplight-studio: update livecheck

This commit is contained in:
Sam Ford 2023-09-29 23:57:46 -04:00
parent 9d51520816
commit c6c036cb45
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D
1 changed files with 9 additions and 4 deletions

View File

@ -12,10 +12,15 @@ cask "stoplight-studio" do
homepage "https://stoplight.io/studio/"
livecheck do
url "https://github.com/stoplightio/studio/releases/latest"
regex(%r{href=.*?/v?(\d+(?:\.\d+)+)[._-]stable[._-]([^/]+)/stoplight[._-]studio[._-]#{arch}\.dmg}i)
strategy :page_match do |page, regex|
page.scan(regex).map { |match| "#{match[0]},#{match[1]}" }
url :url
regex(%r{/v?(\d+(?:\.\d+)+)[._-]stable[._-]([^/]+)/stoplight[._-]studio[._-]#{arch}\.dmg$}i)
strategy :github_latest do |json, regex|
json["assets"]&.map do |asset|
match = asset["browser_download_url"]&.match(regex)
next if match.blank?
"#{match[1]},#{match[2]}"
end
end
end