From: Sebastian Harl Date: Sat, 1 May 2010 20:26:43 +0000 (+0200) Subject: version-gen.sh: Slightly improved robustness against errors. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=42947cc86f25c3aeecf09e61b06b59e2fdbf8db6;p=template.git version-gen.sh: Slightly improved robustness against errors. --- 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