lacy 1.7.1 → 1.7.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/index.mjs +19 -38
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -220,7 +220,7 @@ function removeLacyFromFile(filePath) {
|
|
|
220
220
|
return true;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
// Shared uninstall logic — removes RC lines and install dirs
|
|
223
|
+
// Shared uninstall logic — removes RC lines and install dirs completely
|
|
224
224
|
async function doUninstall({ askConfirm = true } = {}) {
|
|
225
225
|
if (askConfirm) {
|
|
226
226
|
const confirm = await p.confirm({
|
|
@@ -234,24 +234,6 @@ async function doUninstall({ askConfirm = true } = {}) {
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
// Ask about config
|
|
238
|
-
let keepConfig = false;
|
|
239
|
-
if (existsSync(CONFIG_FILE)) {
|
|
240
|
-
const configChoice = await p.confirm({
|
|
241
|
-
message: "Keep configuration for future reinstall?",
|
|
242
|
-
initialValue: true,
|
|
243
|
-
});
|
|
244
|
-
if (!p.isCancel(configChoice)) {
|
|
245
|
-
keepConfig = configChoice;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// Backup config if keeping
|
|
250
|
-
let configBackup = null;
|
|
251
|
-
if (keepConfig && existsSync(CONFIG_FILE)) {
|
|
252
|
-
configBackup = readFileSync(CONFIG_FILE, "utf-8");
|
|
253
|
-
}
|
|
254
|
-
|
|
255
237
|
// Remove from all possible RC files
|
|
256
238
|
const rcSpinner = p.spinner();
|
|
257
239
|
rcSpinner.start("Removing from shell configs");
|
|
@@ -280,15 +262,7 @@ async function doUninstall({ askConfirm = true } = {}) {
|
|
|
280
262
|
rmSync(INSTALL_DIR_OLD, { recursive: true, force: true });
|
|
281
263
|
}
|
|
282
264
|
|
|
283
|
-
|
|
284
|
-
if (configBackup) {
|
|
285
|
-
mkdirSync(INSTALL_DIR, { recursive: true });
|
|
286
|
-
writeFileSync(CONFIG_FILE, configBackup);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
removeSpinner.stop(
|
|
290
|
-
configBackup ? "Installation removed (config preserved)" : "Installation removed",
|
|
291
|
-
);
|
|
265
|
+
removeSpinner.stop("Installation removed");
|
|
292
266
|
|
|
293
267
|
p.log.success("Lacy Shell uninstalled");
|
|
294
268
|
|
|
@@ -396,7 +370,7 @@ async function install() {
|
|
|
396
370
|
|
|
397
371
|
try {
|
|
398
372
|
if (commandExists("npm")) {
|
|
399
|
-
execSync("npm install -g
|
|
373
|
+
execSync("npm install -g lashcode", { stdio: "pipe" });
|
|
400
374
|
lashSpinner.stop("lash installed");
|
|
401
375
|
detected.push("lash");
|
|
402
376
|
} else if (commandExists("brew")) {
|
|
@@ -408,13 +382,13 @@ async function install() {
|
|
|
408
382
|
} else {
|
|
409
383
|
lashSpinner.stop("Could not install lash");
|
|
410
384
|
p.log.warn(
|
|
411
|
-
"Please install npm or homebrew, then run: npm install -g
|
|
385
|
+
"Please install npm or homebrew, then run: npm install -g lashcode",
|
|
412
386
|
);
|
|
413
387
|
}
|
|
414
388
|
} catch (e) {
|
|
415
389
|
lashSpinner.stop("lash installation failed");
|
|
416
390
|
p.log.warn(
|
|
417
|
-
"You can install it manually later: npm install -g
|
|
391
|
+
"You can install it manually later: npm install -g lashcode",
|
|
418
392
|
);
|
|
419
393
|
}
|
|
420
394
|
}
|
|
@@ -457,10 +431,17 @@ async function install() {
|
|
|
457
431
|
p.log.info(`Custom command: ${pc.cyan(customCommand)}`);
|
|
458
432
|
}
|
|
459
433
|
|
|
460
|
-
// Offer to install lash if selected but not installed
|
|
461
|
-
if
|
|
434
|
+
// Offer to install lash if selected but not installed,
|
|
435
|
+
// or if auto-detect was chosen but no tools are available
|
|
436
|
+
const needsLashInstall =
|
|
437
|
+
(selectedTool === "lash" && !commandExists("lash")) ||
|
|
438
|
+
(selectedTool === "auto" && detected.length === 0);
|
|
439
|
+
|
|
440
|
+
if (needsLashInstall) {
|
|
462
441
|
const installLash = await p.confirm({
|
|
463
|
-
message:
|
|
442
|
+
message: selectedTool === "auto"
|
|
443
|
+
? `No AI CLI tools are installed. Would you like to install ${pc.green("lash")} (recommended)?`
|
|
444
|
+
: "lash is not installed. Would you like to install it now?",
|
|
464
445
|
initialValue: true,
|
|
465
446
|
});
|
|
466
447
|
|
|
@@ -475,7 +456,7 @@ async function install() {
|
|
|
475
456
|
|
|
476
457
|
try {
|
|
477
458
|
if (commandExists("npm")) {
|
|
478
|
-
execSync("npm install -g
|
|
459
|
+
execSync("npm install -g lashcode", { stdio: "pipe" });
|
|
479
460
|
lashSpinner.stop("lash installed");
|
|
480
461
|
} else if (commandExists("brew")) {
|
|
481
462
|
execSync("brew tap lacymorrow/tap && brew install lash", {
|
|
@@ -485,13 +466,13 @@ async function install() {
|
|
|
485
466
|
} else {
|
|
486
467
|
lashSpinner.stop("Could not install lash");
|
|
487
468
|
p.log.warn(
|
|
488
|
-
"Please install npm or homebrew, then run: npm install -g
|
|
469
|
+
"Please install npm or homebrew, then run: npm install -g lashcode",
|
|
489
470
|
);
|
|
490
471
|
}
|
|
491
472
|
} catch (e) {
|
|
492
473
|
lashSpinner.stop("lash installation failed");
|
|
493
474
|
p.log.warn(
|
|
494
|
-
"You can install it manually later: npm install -g
|
|
475
|
+
"You can install it manually later: npm install -g lashcode",
|
|
495
476
|
);
|
|
496
477
|
}
|
|
497
478
|
}
|
|
@@ -636,7 +617,7 @@ Commands:
|
|
|
636
617
|
(selectedTool === "auto" && detected.length === 0)
|
|
637
618
|
) {
|
|
638
619
|
p.log.warn("Remember to install an AI CLI tool:");
|
|
639
|
-
console.log(` ${pc.cyan("npm install -g
|
|
620
|
+
console.log(` ${pc.cyan("npm install -g lashcode")}`);
|
|
640
621
|
}
|
|
641
622
|
|
|
642
623
|
await restartShell();
|