feat(commands): add option to change unreleased change title
This commit is contained in:
@@ -240,9 +240,14 @@ program
|
||||
.description("Outputs a markdown formatted changelog")
|
||||
.option("--show-hashes", "show first 9 characters of commit hashes")
|
||||
.option("--last-only", "display only latest release changes")
|
||||
.option(
|
||||
"--unreleased-as <version>",
|
||||
"show unreleased changes as different version"
|
||||
)
|
||||
.action(async (options) => {
|
||||
const showHashes = options.showHashes ? true : false;
|
||||
const lastOnly = options.lastOnly ? true : false;
|
||||
const unreleased = options.unreleasedAs || "Unreleased";
|
||||
|
||||
if ((await simpleGit().tags()).all.length === 0) {
|
||||
return console.log(
|
||||
@@ -261,12 +266,12 @@ program
|
||||
const tag =
|
||||
semver.sort(
|
||||
(await simpleGit().tags([`--contains=${commit.hash}`])).all
|
||||
)[0]! || "Unreleased";
|
||||
)[0]! || unreleased;
|
||||
|
||||
const currentCommitStack = parsedCommitStacks.find(
|
||||
(commitStack) => commitStack.version === tag
|
||||
) || {
|
||||
version: tag || "Unreleased",
|
||||
version: tag || unreleased,
|
||||
breaking: [],
|
||||
features: [],
|
||||
fixes: [],
|
||||
|
||||
Reference in New Issue
Block a user