Files
motion/version.sh
Mr-DaveDev 93c004c915 Update version script for old distros (#561)
* Update version script for old distros and tag dirty status
2017-12-07 17:25:03 -07:00

19 lines
488 B
Bash
Executable File

#!/bin/sh
BASE_VERSION="4.1"
if [ -d .git ]; then
if test "`git diff --name-only`" = "" ; then
GIT_COMMIT="git"
else
GIT_COMMIT="dirty"
fi
GIT_COMMIT=$GIT_COMMIT`git show -s --date=format:'%Y%m%d' --format=%cd-%h` 2>/dev/null
if [ $? -ne 0 ]; then
GIT_COMMIT=$GIT_COMMIT`git show -s --format=%h`
fi
#printf "$BASE_VERSION"
printf "$BASE_VERSION+$GIT_COMMIT"
else
#printf "$BASE_VERSION"
printf "$BASE_VERSION+gitUNKNOWN"
fi