- Makes it safer to globally replace the version string. - Also emphasises its a version, not just a date.
20 lines
481 B
Bash
Executable file
20 lines
481 B
Bash
Executable file
#!/bin/bash
|
|
|
|
|
|
set -e
|
|
|
|
|
|
# Script only runs at the codebase root.
|
|
[ $(basename $PWD) == "eris" ]
|
|
[ -e README.md ]
|
|
|
|
|
|
NEW_VERSION=$(date "+v%Y.%m.%d")
|
|
CURRENT_VERSION=$(git describe --tags --abbrev=0)
|
|
if [ $NEW_VERSION == $CURRENT_VERSION ]; then
|
|
git tag --delete $CURRENT_VERSION
|
|
else
|
|
git grep -l $CURRENT_VERSION | xargs sed -i "s/$CURRENT_VERSION/$NEW_VERSION/g"
|
|
git commit --all --message="Update version from $CURRENT_VERSION to $NEW_VERSION."
|
|
fi
|
|
git tag $NEW_VERSION
|