~strahinja/ufold

1e0b454dd7acbb5f4be1f4c2214b162e6c729580 — Страхиња Радић 1 year, 6 months ago e61abc7
version.do: Update from sled, poe...

Signed-off-by: Страхиња Радић <contact@strahinja.org>
1 files changed, 11 insertions(+), 4 deletions(-)

M version.do
M version.do => version.do +11 -4
@@ 1,7 1,14 @@
if ! git describe >$3; then
	echo "$0: can't call git describe, falling back to 'unknown'" >&2
	echo 'unknown' >$3
FALLBACKVER=${FALLBACKVER:-unknown}
user=$(stat -c %U .)
e_user=$(id -un)
if command -v git >/dev/null 2>&1; then
	if [ "$e_user" = "$user" ]; then
		git describe 2>/dev/null | sed 's/^v//' >$3
	else
		su "${user}" -c 'git describe' 2>/dev/null | sed 's/^v//' >$3
	fi
else
	echo $FALLBACKVER >$3
fi
redo-always
redo-stamp <$3