Skip to content

Commit

Permalink
Add livecheck to ui.rb (Homebrew#133961)
Browse files Browse the repository at this point in the history
* Add livecheck to ui.rb

- Updated to unversioned URL for livecheck
- Set sha256 to no check for unversioned URL
- Merged version array into single version for livecheck
- Added live check
- Opened package using new version

* Switch back to versioned URL

- Added versioned URL back
- Switched only livecheck to unversioned URL
- Updated current version

* Fix livecheck & URL

Co-authored-by: Patrick Linnane <[email protected]>
  • Loading branch information
nilsstreedain and p-linnane authored Oct 21, 2022
1 parent 1b23b38 commit 5073c3d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Casks/ui.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cask "ui" do
version "0.56.3,79aba98f601b49818f3dae0e3d34b754,98a0"
sha256 "d2c338cf371af24f57d511e33b2bec995399d63d803d0fd258d8a2cbb0bcca9c"
version "0.56.3,b2d6dcc1ca1b470db93a710da52de392,b755"
sha256 "d3ce491d37b6aa184247359d1b4f1a5b2e48f6054f521a53d40f4de22b513884"

url "https://fw-download.ubnt.com/data/uid-ui-desktop-app/#{version.csv.third}-macOS-#{version.csv.first}-#{version.csv.second}.pkg",
verified: "fw-download.ubnt.com/data/uid-ui-desktop-app/"
Expand All @@ -9,7 +9,14 @@
homepage "https://www.ui.com/uid"

livecheck do
skip "No version information available"
url "https://api-gw.uid.alpha.ui.com:443/location/api/v1/public/fw/download/latest/?app=UI-DESKTOP-MACOS"
regex(/(\w+)[._-]macOS[._-](\d+(?:\.\d+)+)[._-](\w+)/i)
strategy :header_match do |headers, regex|
match = headers["location"].match(regex)
next if match.blank?

"#{match[2]},#{match[3]},#{match[1]}"
end
end

depends_on macos: ">= :mojave"
Expand Down

0 comments on commit 5073c3d

Please sign in to comment.