1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-06 17:18:12 +03:00
systemd/tools/vcs-tag.sh

21 lines
356 B
Bash
Raw Normal View History

#!/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)"