nwjs: update livecheck

This commit is contained in:
Sam Ford 2023-11-20 17:05:50 -05:00
parent 315f67df2d
commit eb9e065a3a
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D
1 changed files with 10 additions and 2 deletions

View File

@ -10,9 +10,17 @@ cask "nwjs" do
desc "Call all Node.js modules directly from the DOM and Web Workers"
homepage "https://nwjs.io/"
# The upstream download page appends a UNIX epoch timestamp (in milliseconds)
# to the JSON URL, so we do the same (in case it affects the returned data).
livecheck do
url "https://github.com/nwjs/nw.js"
regex(/^nw[._-]v?(\d+(?:\.\d+)+)$/i)
url "https://nwjs.io/versions.json?#{DateTime.now.strftime("%Q")}"
regex(/^v?(\d+(?:\.\d+)+)$/i)
strategy :json do |json, regex|
match = json["stable"]&.match(regex)
next if match.blank?
match[1]
end
end
app "nwjs-sdk-v#{version}-osx-#{arch}/nwjs.app"