Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`npm version` will now automatically replace the text "v.next" with the new version and the date.
- Loading branch information
Showing
3 changed files
with
20 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
set -e | ||
# this script is automatically run by npm when issuing the `npm version` | ||
# command, as long as it is referenced as the "version" npm script. | ||
|
||
# Stamp the changelog | ||
if [ -f "CHANGELOG.md" ] && $(grep -iq "v.next" CHANGELOG.md); then | ||
version=$(node -e "console.log(require('./package.json').version)") | ||
echo "Applying version and date to changelog..." | ||
sed -i "" -e "s/v\.next/${version} - $(date +"%Y-%m-%d")/" CHANGELOG.md | ||
git add CHANGELOG.md | ||
fi |