1
0
mirror of https://github.com/a-h/templ.git synced 2025-02-06 09:45:21 +00:00
templ/push-tag.sh

15 lines
405 B
Bash
Executable File

#!/bin/sh
if [ `git rev-parse --abbrev-ref HEAD` != "main" ]; then
echo "Error: Not on main branch. Please switch to main branch.";
exit 1;
fi
git pull
if ! git diff --quiet; then
echo "Error: Working directory is not clean. Please commit the changes first.";
exit 1;
fi
export VERSION=`cat .version`
echo Adding git tag with version v${VERSION};
git tag v${VERSION};
git push origin v${VERSION};