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.
Files changed (2) hide show
  1. package/lib/index.js +6 -3
  2. 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: true });
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my_wins",
3
- "version": "1.3.3",
3
+ "version": "1.4.0",
4
4
  "description": "Automates starting and laying out your console windows for tsc, babel, tests, verdaccio, etc...",
5
5
  "keywords": [
6
6
  "automation",