Skip to content

Instantly share code, notes, and snippets.

@oliverlundquist
Last active August 29, 2015 14:23
Show Gist options
  • Save oliverlundquist/eca2c1fa5b1ca6f5758c to your computer and use it in GitHub Desktop.
Save oliverlundquist/eca2c1fa5b1ca6f5758c to your computer and use it in GitHub Desktop.
tag_my_repo() {
find ~/repositories/oliverlundquist/repotest -type d -maxdepth 1 -mindepth 1 |
xargs -I '{}' bash -c '
PATH="$1"
VERSION="$2"
cd $PATH
git pull
if [[ -z $(git -C $PATH status -s) ]]
then
sed -i "" "s/0.4.0/0.5.0/g" package.json
sed -i "" "s/0.4.0/0.5.0/g" bower.json
git commit -m "version bump"
git push
git tag -a 0.5.0 -m "0.5.0 release"
git push --tags
echo "tagged repo"
else
echo "cannot git tag no"
fi
' - '{}' "$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment