Skip to content

Commit 1ce7c65

Browse files
authored
Update version.sh (#245)
`git describe --tags` is required to get the correct version tag and the grep regex was changed to match the version pattern x.x.x. The pattern '\d.\d.\d' doesn't seem to work with GNU grep.
1 parent df6190a commit 1ce7c65

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/version.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,20 @@ osx_bundle_sed_path="${builddir}/osx-bundle.sed"
4141

4242
last_svn_revision=6962
4343
last_svn_hash="16cd907fe7482cb54a7374cd28b8501f138116be"
44+
4445
# Check if the commit exists first, it doesn't exist in shallow clones.
4546
if [ "$(git cat-file -t $last_svn_hash 2> /dev/null)" = "commit" ]; then
4647
git_revision=$(expr $last_svn_revision + $(git rev-list --count $last_svn_hash..HEAD))
4748
else
4849
git_revision=0
4950
fi
50-
git_version_str=$(git describe --exact-match 2> /dev/null)
51+
git_version_str=$(git describe --tags --exact-match 2> /dev/null)
5152
installer_version='0.0.0'
5253
resource_version='0, 0, 0'
5354
if test x$git_version_str != x; then
5455
git_version_str="${git_version_str##v}"
5556
tagged_release=1
56-
if [ $(echo $git_version_str | grep '\d\.\d\.\d') ]; then
57+
if [ $(echo $git_version_str | grep '^[0-9]\.[0-9]\.[0-9]$') ]; then
5758
installer_version=$git_version_str
5859
resource_version=$(echo $git_version_str | sed 's/\./, /g')
5960
fi

0 commit comments

Comments
 (0)