diff --git a/command.js b/command.js index 65a6af3dd..3406cd00c 100755 --- a/command.js +++ b/command.js @@ -81,6 +81,11 @@ module.exports = require('yargs') type: 'string', describe: 'Only populate commits made under this path' }) + .option('preset', { + type: 'string', + default: defaults.preset, + describe: 'Commit message guideline preset (default: angular)' + }) .check((argv) => { if (typeof argv.scripts !== 'object' || Array.isArray(argv.scripts)) { throw Error('scripts must be an object') diff --git a/defaults.json b/defaults.json index b70e54697..17035be47 100644 --- a/defaults.json +++ b/defaults.json @@ -10,5 +10,6 @@ "scripts": {}, "skip": {}, "dryRun": false, - "gitTagFallback": true + "gitTagFallback": true, + "preset": "angular" } diff --git a/lib/lifecycles/bump.js b/lib/lifecycles/bump.js index 38a0d7f10..162a312e9 100644 --- a/lib/lifecycles/bump.js +++ b/lib/lifecycles/bump.js @@ -134,7 +134,7 @@ function bumpVersion (releaseAs, args) { } else { conventionalRecommendedBump({ debug: args.verbose && console.info.bind(console, 'conventional-recommended-bump'), - preset: 'angular', + preset: args.preset || 'angular', path: args.path }, function (err, release) { if (err) return reject(err) diff --git a/lib/lifecycles/changelog.js b/lib/lifecycles/changelog.js index c1530fde7..fb2e0f9f3 100644 --- a/lib/lifecycles/changelog.js +++ b/lib/lifecycles/changelog.js @@ -31,7 +31,7 @@ function outputChangelog (args, newVersion) { if (args.dryRun) context = { version: newVersion } var changelogStream = conventionalChangelog({ debug: args.verbose && console.info.bind(console, 'conventional-changelog'), - preset: 'angular', + preset: args.preset || 'angular', tagPrefix: args.tagPrefix }, context, { merges: null, path: args.path }) .on('error', function (err) {