Created
August 18, 2014 15:47
-
-
Save FredKSchott/0019a2131df9bebb7b3b to your computer and use it in GitHub Desktop.
Generating a Changelog with Git - ShellJS Recipes - http://shelljs-recipes.tumblr.com/
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
// dependencies: a git repo, git tag release versioning | |
function generateChangeLog(lastRelease, nextRelease) { | |
echo('Generating Changelog from ' + lastRelease + ' to ' + nextRelease); | |
('## ' + nextRelease + '\n').to('CHANGELOG.tmp'); | |
exec('git log ' + lastRelease + '...' + nextRelease + ' --pretty=format:"+ \`%h\` - %s" >> CHANGELOG.tmp'); | |
cat("CHANGELOG.tmp", "CHANGELOG.md").to("CHANGELOG.new.md"); | |
mv("CHANGELOG.md", "CHANGELOG.old.md"); | |
mv("CHANGELOG.new.md", "CHANGELOG.md"); | |
rm("CHANGELOG.tmp"); | |
rm("CHANGELOG.old.md"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment