Files
motion/scripts/version.sh
2025-02-04 19:06:18 -07:00

18 lines
448 B
Bash
Executable File

#!/bin/sh
BASE_VERSION="5.0.0"
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"