@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 +1 -1
- package/smart-commit/cli.js +7 -2
package/package.json
CHANGED
package/smart-commit/cli.js
CHANGED
|
@@ -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
|
-
|
|
1452
|
-
|
|
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
|
}
|