Files
collectd/version-gen.sh
2024-02-07 09:22:45 +01:00

14 lines
264 B
Bash
Executable File

#!/bin/sh
DEFAULT_VERSION="5.12.0.git"
if [ -d .git ]; then
VERSION="`git describe --tags --dirty=+ --abbrev=7 2> /dev/null | sed -e '/^collectd-/!d' -e 's///' -e 'y/-/./'`"
fi
if test -z "$VERSION"; then
VERSION="$DEFAULT_VERSION"
fi
printf "%s" "$VERSION"