From c810f76c11fb636dbc3697d047f56b72407cfe2a Mon Sep 17 00:00:00 2001 From: Sebastiaan Lokhorst Date: Fri, 21 Oct 2016 12:27:06 +0200 Subject: [PATCH] Fix commit version for non-git versions --- commit-version.sh | 9 +++++++-- git-commit-version.sh | 10 +++++++--- version.sh | 9 +++++++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/commit-version.sh b/commit-version.sh index 5aafdec0..e821a069 100755 --- a/commit-version.sh +++ b/commit-version.sh @@ -1,3 +1,8 @@ #!/bin/sh -SNV_VERSION=`git show -s --format=%h` -echo -n "4.0+git$SNV_VERSION" +BASE_VERSION="4.0" +if [ -d .git ]; then + GIT_COMMIT=`git show -s --format=%h` + echo -n "$BASE_VERSION+git$GIT_COMMIT" +else + echo -n "$BASE_VERSION" +fi diff --git a/git-commit-version.sh b/git-commit-version.sh index 344c47db..e821a069 100755 --- a/git-commit-version.sh +++ b/git-commit-version.sh @@ -1,4 +1,8 @@ #!/bin/sh -SNV_VERSION=`git show -s --format=%h` -echo -n "4.0+git$SNV_VERSION" - +BASE_VERSION="4.0" +if [ -d .git ]; then + GIT_COMMIT=`git show -s --format=%h` + echo -n "$BASE_VERSION+git$GIT_COMMIT" +else + echo -n "$BASE_VERSION" +fi diff --git a/version.sh b/version.sh index 5aafdec0..e821a069 100755 --- a/version.sh +++ b/version.sh @@ -1,3 +1,8 @@ #!/bin/sh -SNV_VERSION=`git show -s --format=%h` -echo -n "4.0+git$SNV_VERSION" +BASE_VERSION="4.0" +if [ -d .git ]; then + GIT_COMMIT=`git show -s --format=%h` + echo -n "$BASE_VERSION+git$GIT_COMMIT" +else + echo -n "$BASE_VERSION" +fi