Skip to content

Commit

Permalink
fix: make pattern for finding CHANGELOG sections work for non anchors (
Browse files Browse the repository at this point in the history
  • Loading branch information
edahlseng authored and bcoe committed Feb 27, 2019
1 parent 04513e8 commit b684c78
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 b684c78

Please sign in to comment.