Skip to content

Commit 3c6c44e

Browse files
author
Ezequiel Bergamaschi
committed
feat(prompter): Add the support of auto prepend the wording: "BREAKING CHANGE: " to the long descrip
Add the support of preprend the wording "BREAKING CHANGE: " to the long description by asking for a simple question before writing the long description. commitizen#17
1 parent 042eadc commit 3c6c44e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

engine.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ module.exports = function (options) {
5656
type: 'input',
5757
name: 'subject',
5858
message: 'Write a short, imperative tense description of the change:\n'
59+
}, {
60+
type: 'input',
61+
name: 'breaking',
62+
message: 'Does your change include a breaking change? [y/n]:\n'
5963
}, {
6064
type: 'input',
6165
name: 'body',
@@ -76,6 +80,11 @@ module.exports = function (options) {
7680
width: maxLineWidth
7781
};
7882

83+
var breaking = answers.breaking[0].trim().toLowerCase() === 'y';
84+
if (breaking) {
85+
answers.body = "BREAKING CHANGE: " + answers.body;
86+
}
87+
7988
// parentheses are only needed when a scope is present
8089
var scope = answers.scope.trim();
8190
scope = scope ? '(' + answers.scope.trim() + ')' : '';

0 commit comments

Comments
 (0)