Skip to content

Commit d18af90

Browse files
author
Luca Huettner
committed
feat: replace the changelog if releaseCount = 0
1 parent 40d27f8 commit d18af90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/lifecycles/changelog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function outputChangelog (args, newVersion) {
2323
createIfMissing(args)
2424
const header = args.header
2525

26-
let oldContent = args.dryRun ? '' : fs.readFileSync(args.infile, 'utf-8')
26+
let oldContent = args.dryRun || args.releaseCount === 0 ? '' : fs.readFileSync(args.infile, 'utf-8')
2727
const oldContentStart = oldContent.search(START_OF_LAST_RELEASE_PATTERN)
2828
// find the position of the last release and remove header:
2929
if (oldContentStart !== -1) {

0 commit comments

Comments
 (0)