@t2code/cli 0.1.6-nightly.20261111.755 → 0.1.6-nightly.20261114.872
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/bin/t2code.mjs +13 -1
- package/package.json +2 -2
package/bin/t2code.mjs
CHANGED
|
@@ -23,8 +23,20 @@ function t2Home() {
|
|
|
23
23
|
return path.resolve(raw);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
const isTransient = (status) => status === 408 || status === 429 || status >= 500;
|
|
27
|
+
|
|
26
28
|
async function get(url) {
|
|
27
|
-
|
|
29
|
+
let response;
|
|
30
|
+
for (let attempt = 1; ; attempt++) {
|
|
31
|
+
try {
|
|
32
|
+
response = await fetch(url);
|
|
33
|
+
if (attempt === 4 || !isTransient(response.status)) break;
|
|
34
|
+
await response.body?.cancel();
|
|
35
|
+
} catch (error) {
|
|
36
|
+
if (attempt === 4) throw error;
|
|
37
|
+
}
|
|
38
|
+
await new Promise((resolve) => setTimeout(resolve, 500 * 2 ** (attempt - 1)));
|
|
39
|
+
}
|
|
28
40
|
if (response.status === 404) {
|
|
29
41
|
throw new Error(
|
|
30
42
|
`${url} does not exist yet. If ${version} was just released, try again in a few minutes.`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2code/cli",
|
|
3
|
-
"version": "0.1.6-nightly.
|
|
3
|
+
"version": "0.1.6-nightly.20261114.872",
|
|
4
4
|
"description": "T2 Code CLI. Downloads the self-contained executable for this platform from the GitHub Release.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
"node": ">=20.11"
|
|
20
20
|
},
|
|
21
21
|
"t2code": {
|
|
22
|
-
"databaseMigration":
|
|
22
|
+
"databaseMigration": 82
|
|
23
23
|
}
|
|
24
24
|
}
|