1
0
Fork 0
systemd/tools/vcs-tag.sh
Daniel Baumann ce097cb8f4
Adding upstream version 257.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 18:07:44 +02:00

20 lines
356 B
Bash
Executable file

#!/bin/bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
MODE="$1"
if ! [[ -d .git ]] ||
! command -v git >/dev/null ||
git describe --tags --exact-match &>/dev/null
then
exit 0
fi
if [[ "$MODE" == "developer" ]]; then
DIRTY="--dirty=^"
else
DIRTY=""
fi
echo "-g$(git describe --abbrev=7 --match="" --always $DIRTY)"