Skip to content

Commit 40d27f8

Browse files
author
Luca Huettner
committed
feat: Expose release count option
1 parent 7fbc106 commit 40d27f8

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

command.js

+5
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ const yargs = require('yargs')
7373
type: 'string',
7474
default: defaults.tagPrefix
7575
})
76+
.option('release-count', {
77+
describe: 'How many releases of changelog you want to generate. It counts from the upcoming release. Useful when you forgot to generate any previous changelog. Set to 0 to regenerate all.',
78+
type: 'number',
79+
default: defaults.releaseCount
80+
})
7681
.option('tag-force', {
7782
describe: 'Allow tag replacement',
7883
type: 'boolean',

defaults.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const defaults = {
88
commitAll: false,
99
silent: false,
1010
tagPrefix: 'v',
11+
releaseCount: 1,
1112
scripts: {},
1213
skip: {},
1314
dryRun: false,

lib/lifecycles/changelog.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ function outputChangelog (args, newVersion) {
3434
const changelogStream = conventionalChangelog({
3535
debug: args.verbose && console.info.bind(console, 'conventional-changelog'),
3636
preset: presetLoader(args),
37-
tagPrefix: args.tagPrefix
37+
tagPrefix: args.tagPrefix,
38+
releaseCount: args.releaseCount
3839
}, context, { merges: null, path: args.path }, args.parserOpts, args.writerOpts)
3940
.on('error', function (err) {
4041
return reject(err)

0 commit comments

Comments
 (0)