repowisestage 0.0.29 → 0.0.30
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 +15 -10
- package/package.json +1 -1
package/dist/bin/repowise.js
CHANGED
|
@@ -2535,24 +2535,29 @@ 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
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2542
|
+
const now = Date.now();
|
|
2543
|
+
const elapsed = now - lastLineTime;
|
|
2544
|
+
lastLineTime = now;
|
|
2545
|
+
if (lines.length === 0) {
|
|
2546
|
+
if (line === "") {
|
|
2547
|
+
rl.close();
|
|
2548
|
+
resolve("");
|
|
2549
|
+
return;
|
|
2550
|
+
}
|
|
2551
|
+
lines.push(line);
|
|
2552
|
+
rl.setPrompt(" > ");
|
|
2553
|
+
rl.prompt();
|
|
2545
2554
|
return;
|
|
2546
2555
|
}
|
|
2547
|
-
if (line === ""
|
|
2548
|
-
if (lines.length > 0 && lines[lines.length - 1] === "") {
|
|
2549
|
-
lines.pop();
|
|
2550
|
-
}
|
|
2556
|
+
if (elapsed > 50 && line === "") {
|
|
2551
2557
|
rl.close();
|
|
2552
2558
|
resolve(lines.join("\n").trim());
|
|
2553
2559
|
return;
|
|
2554
2560
|
}
|
|
2555
|
-
lastLineEmpty = line === "";
|
|
2556
2561
|
lines.push(line);
|
|
2557
2562
|
rl.setPrompt(" > ");
|
|
2558
2563
|
rl.prompt();
|
|
@@ -2587,7 +2592,7 @@ async function handleInterview(syncId, questionId, questionText, questionContext
|
|
|
2587
2592
|
console.log(chalk3.dim(` ${questionContext}`));
|
|
2588
2593
|
}
|
|
2589
2594
|
console.log(` ${questionText}`);
|
|
2590
|
-
console.log(chalk3.dim(' (
|
|
2595
|
+
console.log(chalk3.dim(' (Enter to submit \xB7 Enter to skip \xB7 "done" to finish early)'));
|
|
2591
2596
|
let answer;
|
|
2592
2597
|
try {
|
|
2593
2598
|
answer = await Promise.race([
|