Merge pull request #156659 from samford/clock-bar-update-livecheck
clock-bar: update livecheck
This commit is contained in:
commit
a38dc741c4
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue