@4s1/conventional-commit-creator 3.2.0 → 3.3.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/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { Git } from './git.js';
3
3
  import { loadConfig } from './config.js';
4
4
  import { AppError } from './app-error.js';
5
- import { askForBody, askForDescription, askForIssue, askForScope, askForType } from './questions.js';
5
+ import { askForBody, askForConfirmation, askForDescription, askForIssue, askForScope, askForType } from './questions.js';
6
6
  async function main() {
7
7
  try {
8
8
  const git = new Git();
@@ -25,8 +25,10 @@ async function main() {
25
25
  };
26
26
  const msg = await createMsg(answers, template);
27
27
  console.info(`${'-'.repeat(42)}\n${msg}\n${'-'.repeat(42)}`);
28
- await git.commit(msg);
29
- console.info('done');
28
+ if (await askForConfirmation()) {
29
+ await git.commit(msg);
30
+ console.info('done');
31
+ }
30
32
  }
31
33
  catch (err) {
32
34
  if (err instanceof AppError) {
package/dist/questions.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import select from '@inquirer/select';
2
2
  import input from '@inquirer/input';
3
+ import confirm from '@inquirer/confirm';
3
4
  export function askForType() {
4
5
  return select({
5
6
  message: 'type?',
@@ -110,3 +111,9 @@ export function askForIssue() {
110
111
  },
111
112
  });
112
113
  }
114
+ export function askForConfirmation() {
115
+ return confirm({
116
+ message: 'Is this okay?',
117
+ default: true,
118
+ });
119
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4s1/conventional-commit-creator",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "Conventional Commit Creator",
5
5
  "keywords": [
6
6
  "conventional commit",
@@ -40,6 +40,7 @@
40
40
  },
41
41
  "prettier": "@4s1/eslint-config",
42
42
  "dependencies": {
43
+ "@inquirer/confirm": "^1.0.3",
43
44
  "@inquirer/input": "1.0.3",
44
45
  "@inquirer/select": "1.0.3"
45
46
  },