Skip to content

Commit

Permalink
Merge 8d55009 into cbedc52
Browse files Browse the repository at this point in the history
  • Loading branch information
edahlseng committed Jan 2, 2019
2 parents cbedc52 + 8d55009 commit 324c3a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/lifecycles/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ function outputChangelog (args, newVersion) {
var header = '# Change Log\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n'
var oldContent = args.dryRun ? '' : fs.readFileSync(args.infile, 'utf-8')
// find the position of the last release and remove header:
if (oldContent.indexOf('<a name=') !== -1) {
oldContent = oldContent.substring(oldContent.indexOf('<a name='))
const changelogSectionRegExp = /<a name=|##? \[?[0-9]+\.[0-9]+\.[0-9]+\]?/
if (oldContent.search(changelogSectionRegExp) !== -1) {
oldContent = oldContent.substring(oldContent.search(changelogSectionRegExp))
}
var content = ''
var context
Expand Down

0 comments on commit 324c3a2

Please sign in to comment.