Last active
September 26, 2017 16:59
-
-
Save fabioricali/b387cc690658b065d2a9ced7d2f16727 to your computer and use it in GitHub Desktop.
Read version from package.json and add tag to git
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
#!/usr/bin/env bash | |
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') | |
git commit -a -m "v$PACKAGE_VERSION" | |
git tag -a "v$PACKAGE_VERSION" -m "v$PACKAGE_VERSION" | |
git push --follow-tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment