Merge pull request #156659 from samford/clock-bar-update-livecheck

clock-bar: update livecheck
This commit is contained in:
Razvan Azamfirei 2023-10-01 18:51:44 -04:00 committed by GitHub
commit a38dc741c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 5 deletions

View File

@ -8,11 +8,13 @@ cask "clock-bar" do
homepage "https://github.com/nihalsharma/Clock-Bar/"
livecheck do
url "https://github.com/nihalsharma/Clock-Bar/releases/latest"
regex(%r{href=.*?/tag/(\d+(?:\.\d+)+)}i)
strategy :page_match do |page, regex|
v = page[regex, 1]
id = page[%r{href=.*?/(\d+)/Clock\.Bar\.app\.zip}i, 1]
url :url
regex(/^v?(\d+(?:\.\d+)+)$/i)
strategy :github_latest do |json, regex|
v = json["tag_name"][regex, 1]
id = json["body"][%r{/(\d+)/Clock\.Bar\.app\.zip}i, 1]
next if v.blank? || id.blank?
"#{v},#{id}"
end
end
@ -20,4 +22,9 @@ cask "clock-bar" do
depends_on macos: ">= :sierra"
app "Clock Bar.app"
zap trash: [
"~/Library/Application Scripts/nihalsharma.clock-bar",
"~/Library/Containers/nihalsharma.clock-bar",
]
end