Created
June 19, 2014 13:02
-
-
Save marcusoftnet/4be33a74987d54285607 to your computer and use it in GitHub Desktop.
function for setting next release number
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
BIN = ./node_modules/.bin | |
define release | |
VERSION=`node -pe "require('./package.json').version"` && \ | |
NEXT_VERSION=`node -pe "require('semver').inc(\"$$VERSION\", '$(1)')"` && \ | |
node -e "\ | |
var j = require('./package.json');\ | |
j.version = \"$$NEXT_VERSION\";\ | |
var s = JSON.stringify(j, null, 2);\ | |
require('fs').writeFileSync('./package.json', s);" && \ | |
git commit -m "release $$NEXT_VERSION" -- package.json && \ | |
git tag "$$NEXT_VERSION" -m "release $$NEXT_VERSION" | |
endef |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment