1
0
mirror of https://github.com/restic/restic.git synced 2024-06-24 07:46:38 +02:00
restic/cmd/khepri/version.sh
2014-11-15 19:08:15 +01:00

14 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