Skip to content

Commit

Permalink
feat(conventional-changelog-cli): Add support for the --tag-from flag
Browse files Browse the repository at this point in the history
With this a user can generate a partial changelog starting at a specific tag and proceeding to the current version.

I chose not to attempt a "to" flag as that would make this much more complex and is not needed for my use case just now.
  • Loading branch information
kf6kjg committed Mar 9, 2021
1 parent 49655dd commit 3cbd6a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/conventional-changelog-cli/cli.js
Expand Up @@ -50,6 +50,7 @@ const cli = meow(`
-c, --context A filepath of a json that is used to define template variables
-l, --lerna-package Generate a changelog for a specific lerna package (:pkg-name@1.0.0)
-t, --tag-prefix Tag prefix to consider when reading the tags
--tag-from Tag to start reading from when reading the tags
--commit-path Generate a changelog scoped to a specific directory
`, {
booleanDefault: undefined,
Expand Down Expand Up @@ -171,7 +172,9 @@ try {
process.exit(1)
}

const gitRawCommitsOpts = _.merge({}, config.gitRawCommitsOpts || {})
const gitRawCommitsOpts = _.merge({
from: flags.tagFrom
}, config.gitRawCommitsOpts || {})
if (flags.commitPath) gitRawCommitsOpts.path = flags.commitPath

const changelogStream = conventionalChangelog(options, templateContext, gitRawCommitsOpts, config.parserOpts, config.writerOpts)
Expand Down

0 comments on commit 3cbd6a1

Please sign in to comment.