Skip to content

Commit

Permalink
Fix missing newlines (fixes #46)
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Apr 15, 2022
1 parent d20e50d commit cd55c13
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Expand Up @@ -126,7 +126,12 @@ class ConventionalChangelog extends Plugin {
this.debug({ changelog });
}

fs.writeFileSync(infile, header + EOL + EOL + changelog + previousChangelog);
fs.writeFileSync(
infile,
header +
(changelog ? EOL + EOL + changelog.trim() : '') +
(previousChangelog ? EOL + EOL + previousChangelog.trim() : '')
);

if (!hasInfile) {
await this.exec(`git add ${infile}`);
Expand Down

0 comments on commit cd55c13

Please sign in to comment.