@delta-infra/cli 1.0.28 → 1.0.29
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 +12 -0
- 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
|
+
82da0807522c3068c884fa45d66db62d959626b6441e353205c01b7300e140d1 delta-cli-darwin-amd64.tar.gz
|
|
2
|
+
201cfa4569414aac3425bfd63aed7b787fb45d7f0c61bd6a89b4cc6ca34fb257 delta-cli-darwin-arm64.tar.gz
|
|
3
|
+
f34625f968474c61f5c30fbe76db61b12660ee4e42ed65992d961de0608c19b9 delta-cli-linux-amd64.tar.gz
|
|
4
|
+
db07f3b7fe47af0387cbaf984c000a09fc50920f506c969ea9c4bc07b7d90be8 delta-cli-linux-arm64.tar.gz
|
|
5
|
+
f50337759b256f7a87ac4f5a0a302f5c0fe947e934442c5ed2cf12890020476f 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 {
|
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(
|