From 42947cc86f25c3aeecf09e61b06b59e2fdbf8db6 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sat, 1 May 2010 22:26:43 +0200 Subject: [PATCH] version-gen.sh: Slightly improved robustness against errors. --- version-gen.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/version-gen.sh b/version-gen.sh index a54f2af..ca8414d 100755 --- a/version-gen.sh +++ b/version-gen.sh @@ -2,13 +2,14 @@ DEFAULT_VERSION="0.0.0.git" -VERSION="$( git describe --tags 2> /dev/null | sed -e 's/foobar-//' )" +VERSION="$( git describe --tags 2> /dev/null \ + | sed -e 's/foobar-//' || true )" if test -z "$VERSION"; then VERSION="$DEFAULT_VERSION" else - git update-index -q --refresh - if test -n "$( git diff-index --name-only HEAD )"; then + git update-index -q --refresh || true + if test -n "$( git diff-index --name-only HEAD || true )"; then VERSION="$VERSION-dirty" fi fi -- 2.30.2