@delta-infra/cli 1.0.44 → 1.0.45
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 +22 -7
package/checksums.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
57e1334d81ceffb658b8b7868d9df29d73963ff9534ca49636f982122bda4fc5 delta-cli-darwin-amd64.tar.gz
|
|
2
|
+
68e001e482a5ea0760474bca5d344eac370910a9fa7d920ff5fd6c0f607e5fb9 delta-cli-darwin-arm64.tar.gz
|
|
3
|
+
2864a8670fdb86ac091d58d093b518e5472f92b5832eae4d84774982688d8d73 delta-cli-linux-amd64.tar.gz
|
|
4
|
+
61507fd1bdfa35ef35bb9f6c36d5d331bbae9e7ca5ca24e0e5608325b4b7c0c5 delta-cli-linux-arm64.tar.gz
|
|
5
|
+
36d1cdc11acd621317f882b39dbb144fb3c56656b9cbd0df0b6386cad33da4b0 delta-cli-windows-amd64.zip
|
package/package.json
CHANGED
|
@@ -123,6 +123,21 @@ function osHomedir() {
|
|
|
123
123
|
"/root";
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
function isInteractiveEnv() {
|
|
127
|
+
return !!process.stdin.isTTY &&
|
|
128
|
+
!process.env.CI &&
|
|
129
|
+
!process.env.NO_COLOR &&
|
|
130
|
+
process.env.TERM !== "dumb";
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function createSpinner() {
|
|
134
|
+
if (isInteractiveEnv()) return p.spinner();
|
|
135
|
+
return {
|
|
136
|
+
start: (msg) => { if (msg) console.log(msg); },
|
|
137
|
+
stop: (msg) => { if (msg) console.log(msg); },
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
126
141
|
function whichDeltaCli() {
|
|
127
142
|
try {
|
|
128
143
|
const prefix = execFileSync("npm", ["prefix", "-g"], {
|
|
@@ -189,7 +204,7 @@ async function stepInstallGlobally(msg) {
|
|
|
189
204
|
}
|
|
190
205
|
|
|
191
206
|
const targetVer = latestVer || installedVer;
|
|
192
|
-
const s =
|
|
207
|
+
const s = createSpinner();
|
|
193
208
|
if (needsUpgrade) {
|
|
194
209
|
s.start(fmt(msg.upgrade, PKG, installedVer, latestVer));
|
|
195
210
|
} else {
|
|
@@ -226,7 +241,7 @@ async function skillsAlreadyInstalled() {
|
|
|
226
241
|
}
|
|
227
242
|
|
|
228
243
|
async function stepInstallSkills(msg) {
|
|
229
|
-
const s =
|
|
244
|
+
const s = createSpinner();
|
|
230
245
|
s.start(msg.step2Spinner);
|
|
231
246
|
try {
|
|
232
247
|
if (await skillsAlreadyInstalled()) {
|
|
@@ -260,7 +275,7 @@ async function stepInstallSkills(msg) {
|
|
|
260
275
|
}
|
|
261
276
|
|
|
262
277
|
async function stepConfigInit(msg) {
|
|
263
|
-
const s =
|
|
278
|
+
const s = createSpinner();
|
|
264
279
|
s.start(msg.step3);
|
|
265
280
|
|
|
266
281
|
const deltaCli = whichDeltaCli();
|
|
@@ -325,7 +340,7 @@ async function stepAuthLogin(msg) {
|
|
|
325
340
|
// ── Uninstall steps ─────────────────────────────────────────────────────────
|
|
326
341
|
|
|
327
342
|
async function stepUninstallSkills(msg) {
|
|
328
|
-
const s =
|
|
343
|
+
const s = createSpinner();
|
|
329
344
|
s.start("Removing AI skills...");
|
|
330
345
|
try {
|
|
331
346
|
await runSilentAsync("npx", ["-y", "skills", "remove", "delta-sandbox", "delta-shared", "-g"], {
|
|
@@ -350,7 +365,7 @@ async function stepUninstallPackage(msg) {
|
|
|
350
365
|
if (!installedVer) {
|
|
351
366
|
return;
|
|
352
367
|
}
|
|
353
|
-
const s =
|
|
368
|
+
const s = createSpinner();
|
|
354
369
|
s.start("Removing global package...");
|
|
355
370
|
try {
|
|
356
371
|
await runSilentAsync("npm", ["uninstall", "-g", PKG], { timeout: 60000 });
|
|
@@ -364,7 +379,7 @@ async function stepUninstallPackage(msg) {
|
|
|
364
379
|
// ── Main ────────────────────────────────────────────────────────────────────
|
|
365
380
|
|
|
366
381
|
async function doInstall() {
|
|
367
|
-
const isInteractive =
|
|
382
|
+
const isInteractive = isInteractiveEnv();
|
|
368
383
|
|
|
369
384
|
if (isInteractive) {
|
|
370
385
|
p.intro(messages.zh.setup);
|
|
@@ -382,7 +397,7 @@ async function doInstall() {
|
|
|
382
397
|
}
|
|
383
398
|
|
|
384
399
|
async function doUninstall() {
|
|
385
|
-
const isInteractive =
|
|
400
|
+
const isInteractive = isInteractiveEnv();
|
|
386
401
|
|
|
387
402
|
if (isInteractive) {
|
|
388
403
|
const ok = await p.confirm({
|