Skip to content

Commit 5bc8f62

Browse files
authored
Merge pull request #185706 from Homebrew/bump-wljs-notebook-2.5.6-2.5.6FIX
2 parents 6a176f2 + d0cbe8d commit 5bc8f62

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

Casks/w/wljs-notebook.rb

+28-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,39 @@
11
cask "wljs-notebook" do
22
arch arm: "arm64", intel: "x64"
33

4-
version "2.5.5"
5-
sha256 arm: "4515cfa4b17f7b54361ebd45fb7093a7dbaaafa7ccb2b62a09cb42ecfee4f7f9",
6-
intel: "051956a302fb0a97fc3584f8c7bafc0679bfed8ab77c8c54ecb181723248aa25"
4+
version "2.5.6,2.5.6FIX"
5+
sha256 arm: "0aefd5dfe2f518c3a22e357193f196774e48232a4b7ac8bdeb58c48bcee25d33",
6+
intel: "21f2e42bc6fff7b70e751dc6221a09bd7d613bedccb91b04a69e13ecc78e9377"
77

8-
url "https://github.com/JerryI/wolfram-js-frontend/releases/download/#{version}/wljs-notebook-#{version}-#{arch}.dmg"
8+
url "https://github.com/JerryI/wolfram-js-frontend/releases/download/#{version.csv.second || version.csv.first}/wljs-notebook-#{version.csv.first}-#{arch}.dmg"
99
name "WLJS Notebook"
1010
desc "Javascript frontend for Wolfram Engine"
1111
homepage "https://github.com/JerryI/wolfram-js-frontend"
1212

13+
# The upstream release tag can sometimes differ from the version in the
14+
# filename (e.g. 2.5.6FIX vs. 2.5.6), so we include the tag in the cask
15+
# `version` when this happens.
16+
livecheck do
17+
url :url
18+
regex(/wljs[._-]notebook[._-]v?(\d+(?:\.\d+)+)/i)
19+
strategy :github_releases do |json, regex|
20+
json.map do |release|
21+
next if release["draft"] || release["prerelease"]
22+
23+
tag = release["tag_name"]
24+
tag_version = tag[/^v?(\d+(?:\.\d+)+.*)$/i, 1]
25+
next if tag_version.blank?
26+
27+
release["assets"]&.map do |asset|
28+
match = asset["name"]&.match(regex)
29+
next if match.blank?
30+
31+
(match[1] == tag_version) ? tag_version : "#{match[1]},#{tag}"
32+
end
33+
end.flatten
34+
end
35+
end
36+
1337
auto_updates true
1438
depends_on macos: ">= :catalina"
1539

0 commit comments

Comments
 (0)