restic/cmd/restic/version.sh
2014-12-05 21:45:49 +01:00

13 lines
284 B
Bash
Executable file

#!/bin/sh
VERSION=$(git log --max-count=1 --pretty='%ad-%h' --date=short HEAD 2>/dev/null)
if [ -n "$VERSION" ]; then
if ! sh -c "git diff -s --exit-code && git diff --cached -s --exit-code"; then
VERSION+="+"
fi
else
VERSION="unknown version"
fi
echo $VERSION