|
1 | 1 | cask "wljs-notebook" do
|
2 | 2 | arch arm: "arm64", intel: "x64"
|
3 | 3 |
|
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" |
7 | 7 |
|
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" |
9 | 9 | name "WLJS Notebook"
|
10 | 10 | desc "Javascript frontend for Wolfram Engine"
|
11 | 11 | homepage "https://github.com/JerryI/wolfram-js-frontend"
|
12 | 12 |
|
| 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 | + |
13 | 37 | auto_updates true
|
14 | 38 | depends_on macos: ">= :catalina"
|
15 | 39 |
|
|
0 commit comments