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