prior-cli 1.2.1 → 1.2.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/bin/prior.js +13 -24
- package/package.json +1 -1
package/bin/prior.js
CHANGED
|
@@ -401,35 +401,24 @@ function renderToolSkip(name) {
|
|
|
401
401
|
process.stdout.write(` ${c.warn('⊘')} ${c.muted(name)} ${c.dim('skipped')}\n`);
|
|
402
402
|
}
|
|
403
403
|
|
|
404
|
-
// ──
|
|
404
|
+
// ── Confirm prompt (Enter-based, no raw mode) ─────────────────
|
|
405
405
|
function askConfirmKey(promptText, rl) {
|
|
406
406
|
return new Promise(resolve => {
|
|
407
|
-
process.stdout.
|
|
408
|
-
|
|
409
|
-
if (!process.stdout.isTTY || !process.stdin.isTTY) {
|
|
410
|
-
process.stdout.write(c.ok('y') + '\n');
|
|
407
|
+
if (!process.stdout.isTTY || !process.stdin.isTTY || !rl) {
|
|
408
|
+
process.stdout.write(` ${c.muted('┤')} ${promptText} ${c.muted('[Y/n]')} ${c.ok('y')}\n\n`);
|
|
411
409
|
return resolve(true);
|
|
412
410
|
}
|
|
413
411
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
const key = ch.toLowerCase();
|
|
426
|
-
if (key === '\u0003') { process.stdout.write('\n'); process.exit(0); }
|
|
427
|
-
if (key === 'n') { process.stdout.write(c.err('n') + '\n\n'); return resolve(false); }
|
|
428
|
-
process.stdout.write(c.ok('y') + '\n\n');
|
|
429
|
-
resolve(true);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
process.stdin.on('data', handler);
|
|
412
|
+
rl.question(` ${c.muted('┤')} ${promptText} ${c.muted('[Y/n]')} `, ans => {
|
|
413
|
+
const key = (ans || '').trim().toLowerCase();
|
|
414
|
+
if (key === 'n' || key === 'no') {
|
|
415
|
+
process.stdout.write('\n');
|
|
416
|
+
resolve(false);
|
|
417
|
+
} else {
|
|
418
|
+
process.stdout.write('\n');
|
|
419
|
+
resolve(true);
|
|
420
|
+
}
|
|
421
|
+
});
|
|
433
422
|
});
|
|
434
423
|
}
|
|
435
424
|
|