Skip to content

Commit

Permalink
Add preset option to the cli application
Browse files Browse the repository at this point in the history
  • Loading branch information
aldoreno committed Nov 22, 2018
1 parent 42feb4a commit 948ba86
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions command.js
Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion defaults.json
Expand Up @@ -10,5 +10,6 @@
"scripts": {},
"skip": {},
"dryRun": false,
"gitTagFallback": true
"gitTagFallback": true,
"preset": "angular"
}
2 changes: 1 addition & 1 deletion lib/lifecycles/bump.js
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/lifecycles/changelog.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 948ba86

Please sign in to comment.