1 | 'use strict'
|
2 |
|
3 | fs = require 'fs'
|
4 | objectAssign = require 'object-assign'
|
5 | changelog = require 'conventional-changelog'
|
6 |
|
7 | defaultOptions =
|
8 | releaseCount: 0
|
9 | overwrite: true
|
10 | filename: 'CHANGELOG.md'
|
11 |
|
12 | module.exports = (bumped, plugin, cb) ->
|
13 |
|
14 | options = objectAssign defaultOptions, plugin.options
|
15 | outStream = fs.createWriteStream options.filename
|
16 |
|
17 | delete options.filename
|
18 | changelogStream = changelog options
|
19 | changelogStream.pipe outStream
|
20 |
|
21 | changelogStream.on 'error', cb
|
22 | changelogStream.on 'end', cb
|