Created
March 9, 2016 15:50
-
-
Save leesei/73f5d9d847ae47d05927 to your computer and use it in GitHub Desktop.
update version in `package.json`, tag repo, publish to npm and push to remote #node #npm
This file contains hidden or 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/bash | |
# update version in `package.json`, tag repo, publish to npm and push to remote | |
# expects version as input | |
if [ -z "$1" ]; then | |
echo "Missing version, use those accepted by 'npm version'" | |
echo | |
npm version -h | |
exit | |
fi | |
VERSION=$(npm version "$1" -m "release %s") | |
echo "${VERSION}" && | |
npm publish && | |
git push --follow-tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment