@delta-infra/cli 1.0.28 → 1.0.30
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/checksums.txt +5 -5
- package/package.json +1 -1
- package/scripts/install-wizard.js +31 -11
- package/scripts/install.js +19 -1
- package/scripts/run.js +1 -1
package/checksums.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
619dded6dd11db1c6890b3cc37ce103f4644502861a3171fc594fcfd5447f10e delta-cli-darwin-amd64.tar.gz
|
|
2
|
+
c67b7bb962b33a84e3e8a8674d74ae44c3a1a9943ff5fa1510a4bfe9248a7d25 delta-cli-darwin-arm64.tar.gz
|
|
3
|
+
c438cb04b7600a19746fcdfb3d1b8a6a14dfb7944f21090476df7c809dfe2af7 delta-cli-linux-amd64.tar.gz
|
|
4
|
+
514bce5681f3838549296323c6f8f4f8dd7f7a4ccafcbe49d67393d8829001df delta-cli-linux-arm64.tar.gz
|
|
5
|
+
a232f0249968601038e655ff57316eeeb7b95e6ed37367fd2efd01775115878f delta-cli-windows-amd64.zip
|
package/package.json
CHANGED
|
@@ -188,6 +188,7 @@ async function stepInstallGlobally(msg) {
|
|
|
188
188
|
return false;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
const targetVer = latestVer || installedVer;
|
|
191
192
|
const s = p.spinner();
|
|
192
193
|
if (needsUpgrade) {
|
|
193
194
|
s.start(fmt(msg.upgrade, PKG, installedVer, latestVer));
|
|
@@ -195,7 +196,18 @@ async function stepInstallGlobally(msg) {
|
|
|
195
196
|
s.start(fmt(msg.step1, PKG));
|
|
196
197
|
}
|
|
197
198
|
try {
|
|
199
|
+
// Install the npm package (which triggers postinstall → install.js),
|
|
200
|
+
// then explicitly download the correct version binary in case the
|
|
201
|
+
// npx cache has stale package.json that misleads install.js.
|
|
198
202
|
await runSilentAsync("npm", ["install", "-g", PKG], { timeout: 120000 });
|
|
203
|
+
if (targetVer) {
|
|
204
|
+
await runSilentAsync(process.execPath, [
|
|
205
|
+
path.join(__dirname, "install.js"),
|
|
206
|
+
], {
|
|
207
|
+
timeout: 120000,
|
|
208
|
+
env: { ...process.env, DELTA_CLI_RUN: "true", DELTA_CLI_VERSION: targetVer },
|
|
209
|
+
});
|
|
210
|
+
}
|
|
199
211
|
s.stop(needsUpgrade ? fmt(msg.step1Upgraded, latestVer) : msg.step1Done);
|
|
200
212
|
return needsUpgrade;
|
|
201
213
|
} catch {
|
|
@@ -221,18 +233,26 @@ async function stepInstallSkills(msg) {
|
|
|
221
233
|
s.stop(msg.step2Skip);
|
|
222
234
|
return;
|
|
223
235
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
236
|
+
const GH_PROXY = "https://gh-proxy.com/https://github.com";
|
|
237
|
+
const urls = [
|
|
238
|
+
`${GH_PROXY}/${SKILLS_REPO}`,
|
|
239
|
+
SKILLS_REPO,
|
|
240
|
+
`https://github.com/${SKILLS_REPO}`,
|
|
241
|
+
];
|
|
242
|
+
let lastErr;
|
|
243
|
+
for (const url of urls) {
|
|
244
|
+
try {
|
|
245
|
+
await runSilentAsync("npx", ["-y", "skills", "add", url, "-y", "-g"], {
|
|
246
|
+
timeout: 120000,
|
|
247
|
+
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" },
|
|
248
|
+
});
|
|
249
|
+
s.stop(msg.step2Done);
|
|
250
|
+
return;
|
|
251
|
+
} catch (e) {
|
|
252
|
+
lastErr = e;
|
|
253
|
+
}
|
|
234
254
|
}
|
|
235
|
-
|
|
255
|
+
throw lastErr;
|
|
236
256
|
} catch {
|
|
237
257
|
s.stop(fmt(msg.step2Fail, SKILLS_REPO));
|
|
238
258
|
process.exit(1);
|
package/scripts/install.js
CHANGED
|
@@ -7,7 +7,25 @@ const { execFileSync } = require("child_process");
|
|
|
7
7
|
const os = require("os");
|
|
8
8
|
const crypto = require("crypto");
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const PKG = "@delta-infra/cli";
|
|
11
|
+
|
|
12
|
+
// Resolve the version to download:
|
|
13
|
+
// env var > npm registry > local package.json (fallback)
|
|
14
|
+
function resolveVersion() {
|
|
15
|
+
if (process.env.DELTA_CLI_VERSION) return process.env.DELTA_CLI_VERSION.replace(/^v/, "");
|
|
16
|
+
try {
|
|
17
|
+
const out = require("child_process").execFileSync("npm", ["view", PKG, "version"], {
|
|
18
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
19
|
+
timeout: 15000,
|
|
20
|
+
encoding: "utf8",
|
|
21
|
+
});
|
|
22
|
+
const ver = out.trim();
|
|
23
|
+
if (/^\d+\.\d+\.\d+/.test(ver)) return ver;
|
|
24
|
+
} catch {}
|
|
25
|
+
return require("../package.json").version.replace(/-.*$/, "");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const VERSION = resolveVersion();
|
|
11
29
|
const NAME = "delta-cli";
|
|
12
30
|
const REPO = "yzailab/delta-infra-cli";
|
|
13
31
|
const DEFAULT_ALLOWED_HOSTS = new Set([
|
package/scripts/run.js
CHANGED
|
@@ -45,7 +45,7 @@ if (args[0] === "install" || args[0] === "uninstall") {
|
|
|
45
45
|
try {
|
|
46
46
|
execFileSync(process.execPath, [path.join(__dirname, "install.js")], {
|
|
47
47
|
stdio: "inherit",
|
|
48
|
-
env: { ...process.env, DELTA_CLI_RUN: "true" },
|
|
48
|
+
env: { ...process.env, DELTA_CLI_RUN: "true", DELTA_CLI_VERSION: process.env.DELTA_CLI_VERSION || "" },
|
|
49
49
|
});
|
|
50
50
|
} catch {
|
|
51
51
|
console.error(
|