Skip to content

Commit

Permalink
Merge pull request #196543 from Homebrew/update-livecheck
Browse files Browse the repository at this point in the history
various: update livecheck
  • Loading branch information
bevanjkay authored Dec 27, 2024
2 parents 0062354 + a2a1c40 commit a1e5c30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Casks/o/omnissa-horizon-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
url "https://customerconnect.omnissa.com/channel/public/api/v1.0/products/getRelatedDLGList?locale=en_US&category=desktop_end_user_computing&product=omnissa_horizon_clients&version=8&dlgType=PRODUCT_BINARY"
regex(%r{/([^/]+)/Omnissa[._-]Horizon[._-]Client[._-]v?(\d+(?:[.-]\d+)+)\.dmg}i)
strategy :json do |json, regex|
mac_json_info = json["dlgEditionsLists"]&.select { |item| item["name"]&.match(/mac/i) }&.first
mac_json_info = json["dlgEditionsLists"]&.find { |item| item["name"]&.match(/mac/i) }
next if mac_json_info.blank?

api_item = mac_json_info["dlgList"]&.first
next if api_item.blank?

Expand Down
11 changes: 7 additions & 4 deletions Casks/p/parallels-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
url "https://download.parallels.com/website_links/ras/#{version.csv.first.major}/builds-en_US.json"
regex(/RasClient[._-]Mac[._-]Notarized[._-]v?(\d+(?:\.\d+)+)[._-](\d+)\.pkg/i)
strategy :json do |json, regex|
client_json = json.select { |item| item.dig("category", "name")&.start_with?("Client") }&.first
mac_client_json = client_json&.dig("contents")&.select { |item| item["subcategory"] == "Mac" }&.first
download_url = mac_client_json&.dig("files", "Mac Client")
match = download_url&.match(regex)
client_json = json.find { |item| item.dig("category", "name")&.start_with?("Client") }
next if client_json.blank?

mac_client_json = client_json["contents"]&.find { |item| item["subcategory"] == "Mac" }
next if mac_client_json.blank?

match = mac_client_json.dig("files", "Mac Client")&.match(regex)
next if match.blank?

"#{match[1]},#{match[2]}"
Expand Down

0 comments on commit a1e5c30

Please sign in to comment.