diff --git a/engine.js b/engine.js index ad1e0304..dd1d2701 100644 --- a/engine.js +++ b/engine.js @@ -56,6 +56,10 @@ module.exports = function (options) { type: 'input', name: 'subject', message: 'Write a short, imperative tense description of the change:\n' + }, { + type: 'input', + name: 'breaking', + message: 'Does your change include a breaking change? [y/n]:\n' }, { type: 'input', name: 'body', @@ -76,6 +80,11 @@ module.exports = function (options) { width: maxLineWidth }; + var breaking = answers.breaking[0].trim().toLowerCase() === 'y'; + if (breaking) { + answers.body = "BREAKING CHANGE: " + answers.body; + } + // parentheses are only needed when a scope is present var scope = answers.scope.trim(); scope = scope ? '(' + answers.scope.trim() + ')' : '';