foxitreader: add livecheck (#96846)

This commit is contained in:
Markus Reiter 2020-12-25 08:33:39 +01:00 committed by GitHub
parent 8435a035f2
commit 1663f1b08a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -3,12 +3,18 @@ cask "foxitreader" do
sha256 "c3d3a2c34bd97890ddca30565cd8b8e1707feccde4f0ccdd66f8ece34e3e491e"
url "https://cdn01.foxitsoftware.com/pub/foxit/reader/desktop/mac/#{version.major}.x/#{version.major_minor}/ML/FoxitReader#{version.no_dots}.L10N.Setup.pkg"
appcast "https://macupdater.net/cgi-bin/check_urls/check_url_redirect.cgi?url=https://www.foxitsoftware.com/downloads/latest.html%3Fproduct%3DFoxit-Reader%26platform%3DMac-OS-X",
must_contain: version.no_dots
name "Foxit Reader"
desc "PDF reader"
homepage "https://www.foxitsoftware.com/pdf-reader/"
livecheck do
url "https://www.foxitsoftware.com/downloads/latest.html?product=Foxit-Reader&platform=Mac-OS-X"
strategy :header_match do |headers|
match = headers["location"].match(%r{/(\d+(?:\.\d+)*)/ML/FoxitReader(\d+)\.L10N\.Setup\.pkg}i)
"#{match[1]}.#{match[2].delete_prefix(match[1].delete("."))}"
end
end
pkg "FoxitReader#{version.no_dots}.L10N.Setup.pkg"
uninstall pkgutil: [