acryl 0.1.44 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/desktop-runtime.js +12 -4
- package/package.json +5 -5
package/desktop-runtime.js
CHANGED
|
@@ -51,10 +51,18 @@ function defaultDownload(url) {
|
|
|
51
51
|
|
|
52
52
|
/** Download the matching desktop installer into the managed cache and return its path. */
|
|
53
53
|
export async function acquireDesktopInstaller({ version, download = defaultDownload, open }) {
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
// The installers are assets of the release itself (`v<version>`, with the CLI and Web archives). Releases up to 0.2.1 kept them in a separate `desktop-v<version>` one.
|
|
55
|
+
const tags = [`v${version}`, `desktop-v${version}`]
|
|
56
|
+
let release
|
|
57
|
+
let lastStatus = 0
|
|
58
|
+
for (const tag of tags) {
|
|
59
|
+
const response = await fetch(`${API}/${tag}`, { headers: { Accept: 'application/vnd.github+json' } })
|
|
60
|
+
lastStatus = response.status
|
|
61
|
+
if (!response.ok) continue
|
|
62
|
+
const candidate = await response.json()
|
|
63
|
+
if (Array.isArray(candidate?.assets) && candidate.assets.some(asset => typeof asset?.name === 'string' && /\.(dmg|deb|exe)$/u.test(asset.name))) { release = candidate; break }
|
|
64
|
+
}
|
|
65
|
+
if (release === undefined) fail(`desktop release ${tags.join(' or ')} not found (${lastStatus})`)
|
|
58
66
|
const installer = selectDesktopInstaller(release)
|
|
59
67
|
const root = managedDesktopRoot()
|
|
60
68
|
const dir = join(root, version)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acryl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"README.md"
|
|
16
16
|
],
|
|
17
17
|
"optionalDependencies": {
|
|
18
|
-
"acryl-cli-darwin-arm64": "0.
|
|
19
|
-
"acryl-cli-linux-arm64": "0.
|
|
20
|
-
"acryl-cli-linux-x64": "0.
|
|
21
|
-
"acryl-cli-windows-x64": "0.
|
|
18
|
+
"acryl-cli-darwin-arm64": "0.2.2",
|
|
19
|
+
"acryl-cli-linux-arm64": "0.2.2",
|
|
20
|
+
"acryl-cli-linux-x64": "0.2.2",
|
|
21
|
+
"acryl-cli-windows-x64": "0.2.2"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
24
|
"node": ">=22.19.0 || >=24.0.0"
|