@itcase/config 1.7.15 → 1.7.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/config",
3
- "version": "1.7.15",
3
+ "version": "1.7.16",
4
4
  "author": "ITCase",
5
5
  "description": "ITCase Config",
6
6
  "engines": {
@@ -1447,9 +1447,14 @@ function stageFiles(cwd, files) {
1447
1447
  async function confirm(count) {
1448
1448
  if (!input.isTTY) throw new Error('No TTY — use --yes or --dry-run')
1449
1449
  const rl = readline.createInterface({ input, output })
1450
+ const prompt = `Create ${count} commit(s)? [y/N] `
1450
1451
  try {
1451
- const answer = await rl.question(`Create ${count} commit(s)? [y/N] `)
1452
- return /^y(es)?$/i.test(answer.trim())
1452
+ for (;;) {
1453
+ const answer = (await rl.question(prompt)).trim()
1454
+ if (/^y(es)?$/i.test(answer)) return true
1455
+ if (/^(n(o)?)?$/i.test(answer)) return false
1456
+ output.write('Enter y or n.\n')
1457
+ }
1453
1458
  } finally {
1454
1459
  rl.close()
1455
1460
  }