Files
motion/scripts/version.sh
2022-12-17 17:36:49 -07:00

19 lines
445 B
Bash
Executable File

#!/bin/sh
BASE_VERSION="4.5.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
else
GIT_COMMIT="gitUNKNOWN"
fi
printf "$BASE_VERSION"
#printf "$BASE_VERSION+$GIT_COMMIT"