use VERSIOn instead of calling git

This commit is contained in:
Jakub Sokołowski 2018-05-24 14:57:36 +02:00
parent 60957e70a3
commit 5049d48835
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 2 additions and 2 deletions

View File

@ -23,11 +23,11 @@ if [[ $(git ls-files -m "StatusIm/Info.plist") = *"Info.plist"* ]]; then
echo "version was set in Info.plist"
else
# Build version (closest-tag-or-branch "-" commits-since-tag "-" short-hash dirty-flag)
BUILD_VERSION=$(git describe --tags --always --dirty=+ --match='[0-9]*.[0-9]*.[0-9]*')
BUILD_VERSION="$(cat ../../VERSION)-$(git describe --always --dirty=+)"
# Use the latest tag for short version (expected tag format "vn[.n[.n]]")
# or if there are no tags, we make up version 0.0.<commit count>
LATEST_TAG=$(git describe --tags --abbrev=0 --match='[0-9]*.[0-9]*.[0-9]*' 2>/dev/null) || LATEST_TAG="HEAD"
LATEST_TAG=$(cat ../../VERSION) || LATEST_TAG="HEAD"
if [ $LATEST_TAG = "HEAD" ]
then COMMIT_COUNT=$(git rev-list --count HEAD)
LATEST_TAG="0.0.$COMMIT_COUNT"