Files
collectd/version-gen.sh
2020-09-03 10:34:55 +01:00

14 lines
257 B
Bash
Executable File

#!/bin/sh
DEFAULT_VERSION="5.12.0.git"
if [ -d .git ]; then
VERSION="`git describe --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"