dotfiles/bin/shltag

19 lines
299 B
Bash
Executable File

#!/usr/bin/env bash
old=$(git tag | tail -n1)
force=""
if [[ "$2" == "-f" ]]; then
force="-f"
fi
case $1 in
v*)
git shortlog $old..HEAD | git tag $force -as -F - $1
exit;;
--help)
echo Usage: shltag '[v<version> | --help | -o ]'
exit;;
-o)
# show old tag
echo old is $old;;
esac