Skip to content

Instantly share code, notes, and snippets.

@leesei
Created March 9, 2016 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leesei/73f5d9d847ae47d05927 to your computer and use it in GitHub Desktop.
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
#!/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