repowisestage 0.0.29 → 0.0.31
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/dist/bin/repowise.js +19 -8
- package/package.json +1 -1
package/dist/bin/repowise.js
CHANGED
|
@@ -2535,24 +2535,35 @@ function multilineInput() {
|
|
|
2535
2535
|
return new Promise((resolve, reject) => {
|
|
2536
2536
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
2537
2537
|
const lines = [];
|
|
2538
|
-
let
|
|
2538
|
+
let lastLineTime = 0;
|
|
2539
2539
|
rl.setPrompt(" > ");
|
|
2540
2540
|
rl.prompt();
|
|
2541
2541
|
rl.on("line", (line) => {
|
|
2542
|
-
|
|
2542
|
+
const now = Date.now();
|
|
2543
|
+
const elapsed = now - lastLineTime;
|
|
2544
|
+
lastLineTime = now;
|
|
2545
|
+
const trimmed = line.trim().toLowerCase();
|
|
2546
|
+
if (trimmed === "done" || trimmed === "skip") {
|
|
2543
2547
|
rl.close();
|
|
2544
|
-
resolve(
|
|
2548
|
+
resolve(trimmed);
|
|
2545
2549
|
return;
|
|
2546
2550
|
}
|
|
2547
|
-
if (
|
|
2548
|
-
if (
|
|
2549
|
-
|
|
2551
|
+
if (lines.length === 0) {
|
|
2552
|
+
if (line === "") {
|
|
2553
|
+
rl.close();
|
|
2554
|
+
resolve("");
|
|
2555
|
+
return;
|
|
2550
2556
|
}
|
|
2557
|
+
lines.push(line);
|
|
2558
|
+
rl.setPrompt(" > ");
|
|
2559
|
+
rl.prompt();
|
|
2560
|
+
return;
|
|
2561
|
+
}
|
|
2562
|
+
if (elapsed > 50 && line === "") {
|
|
2551
2563
|
rl.close();
|
|
2552
2564
|
resolve(lines.join("\n").trim());
|
|
2553
2565
|
return;
|
|
2554
2566
|
}
|
|
2555
|
-
lastLineEmpty = line === "";
|
|
2556
2567
|
lines.push(line);
|
|
2557
2568
|
rl.setPrompt(" > ");
|
|
2558
2569
|
rl.prompt();
|
|
@@ -2587,7 +2598,7 @@ async function handleInterview(syncId, questionId, questionText, questionContext
|
|
|
2587
2598
|
console.log(chalk3.dim(` ${questionContext}`));
|
|
2588
2599
|
}
|
|
2589
2600
|
console.log(` ${questionText}`);
|
|
2590
|
-
console.log(chalk3.dim(' (
|
|
2601
|
+
console.log(chalk3.dim(' (Enter to submit \xB7 Enter to skip \xB7 "done" to finish early)'));
|
|
2591
2602
|
let answer;
|
|
2592
2603
|
try {
|
|
2593
2604
|
answer = await Promise.race([
|