From 1c0e1dba7a02db9df36badac1df36c74a112e5c8 Mon Sep 17 00:00:00 2001 From: JaminYe Date: Sun, 7 Jan 2024 23:35:34 +0800 Subject: [PATCH] add another arch name,update livecheck use page_match to get the latest --- Casks/p/prettyclean.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Casks/p/prettyclean.rb b/Casks/p/prettyclean.rb index a955edc076..7bab258009 100644 --- a/Casks/p/prettyclean.rb +++ b/Casks/p/prettyclean.rb @@ -1,11 +1,12 @@ cask "prettyclean" do arch arm: "aarch64", intel: "x86_64" + framework = on_arch_conditional arm: "aarch64", intel: "x64" version "0.1.38" sha256 arm: "1832d6ffdbe0fcbffe35c3b2f6ac4031e7e8ce93a7c564124914888ebfb43885", intel: "bc7512ff7544d8522ebd1ac0c13e94da8661dd6a5772bda33d68a9145be73436" - url "https://downloads.jmotor.org/prettyclean/v#{version}/darwin-#{arch}/PrettyClean_#{version}_#{arch.gsub("86_", "")}.dmg", + url "https://downloads.jmotor.org/prettyclean/v#{version}/darwin-#{arch}/PrettyClean_#{version}_#{framework}.dmg", verified: "downloads.jmotor.org/" name "PrettyClean" desc "Easy to use Disk Cleanup Tools" @@ -13,7 +14,13 @@ cask "prettyclean" do livecheck do url "https://www.prettyclean.cc/en/download" - regex(/href=.*?PrettyClean[._-]v?(\d+(?:\.\d+)+)[._-]#{arch}\.dmg/i) + regex(/href=.*?PrettyClean[._-]v?(\d+(?:\.\d+)+)[._-]#{framework}\.dmg/i) + strategy :page_match do |page, regex| + match = page.match(regex) + next if match.blank? + + match[1] + end end depends_on macos: ">= :high_sierra"