Skip to content

Commit

Permalink
Fix changelog generation for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
gesposito committed May 14, 2018
1 parent 5f0ed88 commit f93cab6
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions scripts/changelog.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
const conventionalChangelog = require("conventional-changelog");

module.exports.getChangelog = async () => {
let content;
let content = "";

const changelogStream = conventionalChangelog({});
const changelogStream = conventionalChangelog(
{
// `conventional-changelog` options
releaseCount: 2
},
{
// `context` goes here
},
{
// `git-raw-commits` options
merges: null
},
{
// `conventional-commits-parser` options
},
{
// `conventional-changelog-writer` options
}
);

return new Promise(function(resolve, reject) {
changelogStream.on("data", (buffer) => content += buffer.toString());
changelogStream.on("data", buffer => (content += buffer.toString()));
changelogStream.on("end", () => resolve(content));
changelogStream.on("error", (err) => reject(err));
changelogStream.on("error", err => reject(err));
});
};

0 comments on commit f93cab6

Please sign in to comment.