Scripts(shltag): Add -f option for git tag -f

Recently had some drama in mucking up gelim tags so I had no choice but
to improve my tooling.
This commit is contained in:
hedy 2022-03-31 17:51:32 +08:00
parent 33724ae421
commit e5f3d5f53e
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 5 additions and 1 deletions

View File

@ -1,9 +1,13 @@
#!/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 -as -F - $1
git shortlog $old..HEAD | git tag $force -as -F - $1
exit;;
--help)
echo Usage: shltag '[v<version> | --help | -o ]'