From aa0ae29a257858a58b2993a0bf1fd2077cd41b6f Mon Sep 17 00:00:00 2001 From: JaminYe Date: Fri, 5 Jan 2024 10:43:50 +0800 Subject: [PATCH 1/7] add prettyclean cask --- Casks/p/prettyclean.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Casks/p/prettyclean.rb diff --git a/Casks/p/prettyclean.rb b/Casks/p/prettyclean.rb new file mode 100644 index 0000000000..b6a7a9dd7c --- /dev/null +++ b/Casks/p/prettyclean.rb @@ -0,0 +1,29 @@ +cask "prettyclean" do + arch arm: "aarch64", intel: "x86_64" + + version "0.1.38" + sha256 "bc7512ff7544d8522ebd1ac0c13e94da8661dd6a5772bda33d68a9145be73436" + + url "https://downloads.jmotor.org/prettyclean/v#{version}/darwin-#{arch}/PrettyClean_#{version}_#{arch.gsub("86_", "")}.dmg", + verified: "downloads.jmotor.org/" + name "prettyclean" + desc "Easy to use Disk Cleanup Tools" + homepage "https://www.prettyclean.cc/" + + livecheck do + url :url + strategy :extract_plist do |items| + items["cc.prettyclean.PrettyClean"].short_version + end + end + + depends_on macos: ">=:high_sierra" + + app "PrettyClean.app" + + zap trash: [ + "~/Library/Caches/cc.prettyclean.PrettyClean", + "~/Library/Logs/PrettyClean", + "~/Library/WebKit/cc.prettyclean.PrettyClean", + ] +end From 218c13379cf721acf22fb109219b21bfab9665dd Mon Sep 17 00:00:00 2001 From: JaminYe Date: Fri, 5 Jan 2024 10:50:05 +0800 Subject: [PATCH 2/7] add arm sha256 --- Casks/p/prettyclean.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Casks/p/prettyclean.rb b/Casks/p/prettyclean.rb index b6a7a9dd7c..e8d068c15c 100644 --- a/Casks/p/prettyclean.rb +++ b/Casks/p/prettyclean.rb @@ -2,7 +2,8 @@ cask "prettyclean" do arch arm: "aarch64", intel: "x86_64" version "0.1.38" - sha256 "bc7512ff7544d8522ebd1ac0c13e94da8661dd6a5772bda33d68a9145be73436" + sha256 arm: "1832d6ffdbe0fcbffe35c3b2f6ac4031e7e8ce93a7c564124914888ebfb43885", + intel: "bc7512ff7544d8522ebd1ac0c13e94da8661dd6a5772bda33d68a9145be73436" url "https://downloads.jmotor.org/prettyclean/v#{version}/darwin-#{arch}/PrettyClean_#{version}_#{arch.gsub("86_", "")}.dmg", verified: "downloads.jmotor.org/" From 32d101e0330f3b553633e60d560789d9b2910757 Mon Sep 17 00:00:00 2001 From: JaminYe Date: Fri, 5 Jan 2024 11:05:27 +0800 Subject: [PATCH 3/7] fix depends_on macos --- Casks/p/prettyclean.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Casks/p/prettyclean.rb b/Casks/p/prettyclean.rb index e8d068c15c..50e0ed7726 100644 --- a/Casks/p/prettyclean.rb +++ b/Casks/p/prettyclean.rb @@ -18,7 +18,7 @@ cask "prettyclean" do end end - depends_on macos: ">=:high_sierra" + depends_on macos: ">= :high_sierra" app "PrettyClean.app" From 434d88bf077841776fbae649a9a7ec911dfcd5b8 Mon Sep 17 00:00:00 2001 From: JaminYe Date: Sun, 7 Jan 2024 22:17:47 +0800 Subject: [PATCH 4/7] Update Casks/p/prettyclean.rb Co-authored-by: Bevan Kay --- Casks/p/prettyclean.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Casks/p/prettyclean.rb b/Casks/p/prettyclean.rb index 50e0ed7726..ce333ccf3c 100644 --- a/Casks/p/prettyclean.rb +++ b/Casks/p/prettyclean.rb @@ -7,7 +7,7 @@ cask "prettyclean" do url "https://downloads.jmotor.org/prettyclean/v#{version}/darwin-#{arch}/PrettyClean_#{version}_#{arch.gsub("86_", "")}.dmg", verified: "downloads.jmotor.org/" - name "prettyclean" + name "PrettyClean" desc "Easy to use Disk Cleanup Tools" homepage "https://www.prettyclean.cc/" From 5b4fa10588e80263750fb2e750bf4e720f53bb37 Mon Sep 17 00:00:00 2001 From: JaminYe Date: Sun, 7 Jan 2024 22:18:43 +0800 Subject: [PATCH 5/7] Update Casks/p/prettyclean.rb change livecheck Co-authored-by: Bevan Kay --- Casks/p/prettyclean.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Casks/p/prettyclean.rb b/Casks/p/prettyclean.rb index ce333ccf3c..a955edc076 100644 --- a/Casks/p/prettyclean.rb +++ b/Casks/p/prettyclean.rb @@ -12,10 +12,8 @@ cask "prettyclean" do homepage "https://www.prettyclean.cc/" livecheck do - url :url - strategy :extract_plist do |items| - items["cc.prettyclean.PrettyClean"].short_version - end + url "https://www.prettyclean.cc/en/download" + regex(/href=.*?PrettyClean[._-]v?(\d+(?:\.\d+)+)[._-]#{arch}\.dmg/i) end depends_on macos: ">= :high_sierra" From 1c0e1dba7a02db9df36badac1df36c74a112e5c8 Mon Sep 17 00:00:00 2001 From: JaminYe Date: Sun, 7 Jan 2024 23:35:34 +0800 Subject: [PATCH 6/7] 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" From bfe443baa86a60328bf36ddd0db9406232ddf3bc Mon Sep 17 00:00:00 2001 From: Bevan Kay Date: Mon, 8 Jan 2024 10:13:40 +1100 Subject: [PATCH 7/7] prettyclean: update `arch` conditionals --- Casks/p/prettyclean.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Casks/p/prettyclean.rb b/Casks/p/prettyclean.rb index 7bab258009..99ba006323 100644 --- a/Casks/p/prettyclean.rb +++ b/Casks/p/prettyclean.rb @@ -1,12 +1,12 @@ cask "prettyclean" do - arch arm: "aarch64", intel: "x86_64" - framework = on_arch_conditional arm: "aarch64", intel: "x64" + arch arm: "aarch64", intel: "x64" + arch_folder = on_arch_conditional arm: "aarch64", intel: "x86_64" version "0.1.38" sha256 arm: "1832d6ffdbe0fcbffe35c3b2f6ac4031e7e8ce93a7c564124914888ebfb43885", intel: "bc7512ff7544d8522ebd1ac0c13e94da8661dd6a5772bda33d68a9145be73436" - url "https://downloads.jmotor.org/prettyclean/v#{version}/darwin-#{arch}/PrettyClean_#{version}_#{framework}.dmg", + url "https://downloads.jmotor.org/prettyclean/v#{version}/darwin-#{arch_folder}/PrettyClean_#{version}_#{arch}.dmg", verified: "downloads.jmotor.org/" name "PrettyClean" desc "Easy to use Disk Cleanup Tools" @@ -14,13 +14,7 @@ cask "prettyclean" do livecheck do url "https://www.prettyclean.cc/en/download" - 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 + regex(/href=.*?PrettyClean[._-]v?(\d+(?:\.\d+)+)[._-]#{arch}\.dmg/i) end depends_on macos: ">= :high_sierra"