@nevermorelove/ompp 0.3.0 → 0.3.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/ompp.js +10 -15
- package/package.json +1 -1
package/ompp.js
CHANGED
|
@@ -64,16 +64,14 @@ function isNewerVersion(current, latest) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
function printUpdateBanner(current, latest) {
|
|
67
|
-
const line = `Update available! ${current}
|
|
67
|
+
const line = `Update available! ${current} -> ${latest}`;
|
|
68
68
|
const hint = `Run "npm i -g @nevermorelove/ompp" to update`;
|
|
69
|
-
const
|
|
70
|
-
const pad = (s) => "
|
|
71
|
-
console.error("┌" + "─".repeat(
|
|
72
|
-
console.error("│" + " ".repeat(width) + "│");
|
|
69
|
+
const inner = Math.max(line.length, hint.length) + 2;
|
|
70
|
+
const pad = (s) => " " + s + " ".repeat(inner - 1 - s.length);
|
|
71
|
+
console.error("┌" + "─".repeat(inner) + "┐");
|
|
73
72
|
console.error("│" + pad(line) + "│");
|
|
74
73
|
console.error("│" + pad(hint) + "│");
|
|
75
|
-
console.error("
|
|
76
|
-
console.error("└" + "─".repeat(width) + "┘");
|
|
74
|
+
console.error("└" + "─".repeat(inner) + "┘");
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
async function checkForUpdate() {
|
|
@@ -496,10 +494,7 @@ async function main() {
|
|
|
496
494
|
try {
|
|
497
495
|
const picked = await pickMode([]);
|
|
498
496
|
if (picked && typeof picked === "object" && picked.create) {
|
|
499
|
-
|
|
500
|
-
if (created !== 0) return created;
|
|
501
|
-
const mode2 = { name: picked.create, source: DEFAULT_MODES_DIR };
|
|
502
|
-
return launchMode(mode2, userArgs, dryRun);
|
|
497
|
+
return createMode(picked.create);
|
|
503
498
|
}
|
|
504
499
|
return 1;
|
|
505
500
|
} catch (err) {
|
|
@@ -530,10 +525,10 @@ async function main() {
|
|
|
530
525
|
? await pickMode(modeNames)
|
|
531
526
|
: await pickModePiped(modeNames);
|
|
532
527
|
if (picked && typeof picked === "object" && picked.create) {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
//
|
|
536
|
-
|
|
528
|
+
// Scaffold and stop: the mode is all placeholders, launching it
|
|
529
|
+
// now would run an unconfigured mode. The user fills it in and
|
|
530
|
+
// launches when ready.
|
|
531
|
+
return createMode(picked.create);
|
|
537
532
|
} else {
|
|
538
533
|
mode = modes.find((m) => m.name === picked);
|
|
539
534
|
}
|