my_wins 1.3.3 → 1.4.0
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/lib/index.js +6 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -242,9 +242,9 @@ async function runOnce(baseSettings, filterNames) {
|
|
|
242
242
|
console.log(`my_wins finished successfully!`);
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
async function promptMenu(winNames) {
|
|
245
|
+
async function promptMenu(winNames, exitChecked) {
|
|
246
246
|
const choices = winNames.map((name)=>({ name, value: name }));
|
|
247
|
-
choices.push({ name: "exit", value: "__exit__", checked:
|
|
247
|
+
choices.push({ name: "exit", value: "__exit__", checked: !!exitChecked });
|
|
248
248
|
const prompt = inquirer.prompt || (inquirer.default && inquirer.default.prompt);
|
|
249
249
|
if (!prompt) {
|
|
250
250
|
throw new Error("Inquirer prompt API is unavailable. Please use a compatible inquirer version.");
|
|
@@ -254,6 +254,7 @@ async function promptMenu(winNames) {
|
|
|
254
254
|
type: "checkbox",
|
|
255
255
|
name: "selections",
|
|
256
256
|
message: "Select commands to run",
|
|
257
|
+
pageSize: Math.min(choices.length, 21),
|
|
257
258
|
choices,
|
|
258
259
|
},
|
|
259
260
|
]);
|
|
@@ -281,8 +282,10 @@ module.exports.run = async ()=>{
|
|
|
281
282
|
console.log("No wins configured.");
|
|
282
283
|
process.exit(0);
|
|
283
284
|
}
|
|
285
|
+
let isFirstRun = true;
|
|
284
286
|
while (true) {
|
|
285
|
-
const selections = await promptMenu(winNames);
|
|
287
|
+
const selections = await promptMenu(winNames, isFirstRun);
|
|
288
|
+
isFirstRun = false;
|
|
286
289
|
const exitSelected = selections.includes("__exit__");
|
|
287
290
|
const selectedNames = selections.filter((item)=>item !== "__exit__");
|
|
288
291
|
if (selectedNames.length) {
|