From f5f67a7902ce20274c74e4578caf8b83b5da4989 Mon Sep 17 00:00:00 2001 From: Klaus Hipp Date: Sat, 10 Aug 2024 17:05:17 +0200 Subject: [PATCH] garmin-express: update livecheck, add legacy version Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com> --- Casks/g/garmin-express.rb | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/Casks/g/garmin-express.rb b/Casks/g/garmin-express.rb index 957d0ac70130..3c4fd87bf4a8 100644 --- a/Casks/g/garmin-express.rb +++ b/Casks/g/garmin-express.rb @@ -1,17 +1,37 @@ cask "garmin-express" do - version "7.22.1.0,7220100" - sha256 :no_check + on_catalina :or_older do + version "7.18.0" + sha256 "f032349fa2b4cd5abe20ae9201c905874a4d3ef1b328966a29d24e6e15793729" + + url "https://download.garmin.com/omt/express/GarminExpress_#{version}_OS10x.dmg" + + livecheck do + skip "Legacy version" + end + end + on_big_sur :or_newer do + version "7.22.1" + sha256 :no_check + + url "https://download.garmin.com/omt/express/GarminExpress.dmg" + + # From https://support.garmin.com/en-US/?productID=168768&tab=software + livecheck do + url "https://support.garmin.com/capi/faq/details/?locale=en-US&faqId=9MuiEv9c2y2wgcXvzEVEe8" + regex(/for\s+Mac:?[\s\u00a0]*?v?(\d+(?:\.\d+)+)/i) + strategy :json do |json, regex| + match = json["content"]&.match(regex) + next if match.blank? + + match[1] + end + end + end - url "https://download.garmin.com/omt/express/GarminExpress.dmg" name "Garmin Express" desc "Update maps and software, sync with Garmin Connect and register your device" homepage "https://www.garmin.com/en-US/software/express" - livecheck do - url :url - strategy :extract_plist - end - auto_updates true pkg "Install Garmin Express.pkg"