-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(changelog): regenerate changeling when release count = 0
Improve documentation for release count flag and tests
- Loading branch information
Showing
4 changed files
with
86 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
'use strict'; | ||
const log = require('./log'); | ||
const fs = require('fs'); | ||
const prependFile = require('prepend-file'); | ||
const path = require('path'); | ||
|
||
module.exports = function writeChangelog(data, verbose) { | ||
module.exports = function writeChangelog(data, replaceContents, verbose) { | ||
if (verbose === undefined) verbose = false; | ||
|
||
// var writeFileSync = fs.writeFileSync; | ||
let fileName = path.join(process.cwd(), 'CHANGELOG.md'); | ||
if (verbose) log.info('>>> About to write/append contents to CHANGELOG.md... '); | ||
prependFile.sync(fileName, data); | ||
|
||
if (replaceContents) { | ||
fs.writeFileSync(fileName, data); | ||
} else { | ||
prependFile.sync(fileName, data); | ||
} | ||
}; |