repowisestage 0.0.28 → 0.0.29
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 +17 -10
- package/package.json +1 -1
package/dist/bin/repowise.js
CHANGED
|
@@ -2535,24 +2535,31 @@ 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 lastLineEmpty = false;
|
|
2538
2539
|
rl.setPrompt(" > ");
|
|
2539
2540
|
rl.prompt();
|
|
2540
2541
|
rl.on("line", (line) => {
|
|
2541
|
-
if (line === "" && lines.length
|
|
2542
|
-
rl.close();
|
|
2543
|
-
resolve(lines.join("\n"));
|
|
2544
|
-
} else if (line === "" && lines.length === 0) {
|
|
2542
|
+
if (line === "" && lines.length === 0) {
|
|
2545
2543
|
rl.close();
|
|
2546
2544
|
resolve("");
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2545
|
+
return;
|
|
2546
|
+
}
|
|
2547
|
+
if (line === "" && lastLineEmpty) {
|
|
2548
|
+
if (lines.length > 0 && lines[lines.length - 1] === "") {
|
|
2549
|
+
lines.pop();
|
|
2550
|
+
}
|
|
2551
|
+
rl.close();
|
|
2552
|
+
resolve(lines.join("\n").trim());
|
|
2553
|
+
return;
|
|
2551
2554
|
}
|
|
2555
|
+
lastLineEmpty = line === "";
|
|
2556
|
+
lines.push(line);
|
|
2557
|
+
rl.setPrompt(" > ");
|
|
2558
|
+
rl.prompt();
|
|
2552
2559
|
});
|
|
2553
2560
|
rl.on("close", () => {
|
|
2554
2561
|
if (lines.length > 0) {
|
|
2555
|
-
resolve(lines.join("\n"));
|
|
2562
|
+
resolve(lines.join("\n").trim());
|
|
2556
2563
|
} else {
|
|
2557
2564
|
resolve("");
|
|
2558
2565
|
}
|
|
@@ -2580,7 +2587,7 @@ async function handleInterview(syncId, questionId, questionText, questionContext
|
|
|
2580
2587
|
console.log(chalk3.dim(` ${questionContext}`));
|
|
2581
2588
|
}
|
|
2582
2589
|
console.log(` ${questionText}`);
|
|
2583
|
-
console.log(chalk3.dim(' (
|
|
2590
|
+
console.log(chalk3.dim(' (Two empty lines to submit \xB7 Enter to skip \xB7 "done" to finish early)'));
|
|
2584
2591
|
let answer;
|
|
2585
2592
|
try {
|
|
2586
2593
|
answer = await Promise.race([
|