free-gpgmail: update livecheck

This commit is contained in:
Sam Ford 2023-03-22 10:41:59 -04:00 committed by Bevan Kay
parent 683c89ee73
commit 91f0f1b20a
1 changed files with 2 additions and 2 deletions

View File

@ -26,11 +26,11 @@ cask "free-gpgmail" do
# surface a new major version and that will need to be handled manually.
livecheck do
url "https://github.com/Free-GPGMail/Free-GPGMail/releases?q=prerelease%3Afalse"
regex(/.*?Free-GPGMail[._-]v?(\d+(?:\.\d+)?)[_-](\d+(?:\.\d+)+)([_-][^"' >]+?)?[._-]mailbundle\.zip/i)
regex(/.*?Free-GPGMail[._-]v?(\d+(?:\.\d+)*)[_-](\d+(?:\.\d+)+)([_-][^"' >]+?)?[._-]mailbundle\.zip/i)
strategy :page_match do |page, regex|
version_suffix = version.csv.third&.sub(/^[_-]/, "")
page.scan(regex).map do |match|
next if match[0] != version.csv.first
next if match[0].split(".").first != version.csv.first.split(".").first
next if match[2]&.sub(/^[_-]/, "") != version_suffix
"#{match[0]},#{match[1]},#{match[2]}"