katapult/scripts/make-version.sh
Eric Callahan 4a1532ef24 flashcmd: add support for reporting software version
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-08-06 19:41:37 -04:00

13 lines
290 B
Bash
Executable File

#!/bin/sh
# Detect the version of Katapult
a="/$0"; a="${a%/*}"; a="${a:-.}"; a="${a##/}/"; SRCDIR=$(cd "$a/.."; pwd)
if [ -e "${SRCDIR}/.git" ]; then
git describe --tags --long --always --dirty
elif [ -f "${SRCDIR}/.version" ]; then
cat "${SRCDIR}/.version"
else
echo "?"
fi