Files
ansible/bin/gittag
T
Bart Sjerps b14134c56c update
2026-04-20 10:00:31 +02:00

19 lines
397 B
Bash
Executable File

#!/usr/bin/bash
DIR=$(git rev-parse --show-toplevel) || exit 10
NAME=$(rpm -q --qf '%{name}\n' --specfile ${DIR}/*.spec)
VERSION=$(rpm -q --qf '%{version}\n' --specfile ${DIR}/*.spec)
while getopts ":h:" OPT; do
case "$OPT" in
\?|h) usage ; exit 0 ;;
esac
done
shift $((OPTIND-1))
case $1 in
apply) git tag -a -mversion v${VERSION} ;;
*) echo git tag -a -mversion v${VERSION} ;;
esac