-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from raizo07/feat/generateChangelog
Feat/generate changelog
- Loading branch information
Showing
4 changed files
with
8,032 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const fs = require("fs"); | ||
const { version } = require("./package.json"); | ||
|
||
// write changelog to CHANGELOG.md | ||
fs.writeFileSync("CHANGELOG.md", changelogContent); | ||
|
||
// Update current version in README | ||
fs.readFile("README.md", "utf8", (err, data) => { | ||
if (err) { | ||
console.error(err); | ||
return; | ||
} | ||
|
||
const updatedReadme = data.replace(/CURRENT_VERSION_PLACEHOLDER/g, version); | ||
fs.writeFile("README.md", updatedReadme, "utf8", (err) => { | ||
if (err) { | ||
console.error(err); | ||
return; | ||
} | ||
console.log("README updated with current version"); | ||
}); | ||
}); |
Oops, something went wrong.