#!/bin/sh

set -e

if [ -d .git ] ; then
    version="$(git describe --dirty)"
elif [ -f version ] ; then
    version="$(cat version)"
else
    version="unknown"
fi

echo "#define BABELD_VERSION \"$version\""

#!/bin/sh

set -e

if [ -d .git ] && [ "$(git tag)" ] ; then
    version="$(git describe --dirty)"
elif [ -f version ] ; then
    version="$(cat version)"
else
    version="unknown"
fi

echo "#define BABELD_VERSION \"$version\""

Fix version name generation when there are no tag
Fix version name generation when there are no tag

Set the version to be "unknown" when the git repository does not contain
any tags.
