Created
June 8, 2019 21:40
-
-
Save fooman/a88df69b1b259d3efd95a98248493969 to your computer and use it in GitHub Desktop.
Keep composer version in sync with git tag
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/bash | |
# tested on MacOS - uses gsed | |
# brew install gnu-sed | |
TAG="$1" | |
if [[ -z "$TAG" ]]; then | |
echo "Usage: tag-release.sh TAG" | |
echo " Example: tag-release.sh 1.0.0" | |
exit 1 | |
fi | |
gsed -i 's#"version":[[:space:]]"[^0-9.]*\([0-9.]*\).*"#"version": "'${TAG}'"#' composer.json | |
git add composer.json | |
git commit -m "Bumped version to ${TAG}" | |
git tag ${TAG} | |
git push | |
git push --tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment