Use git-tagged version when packaging

`git describe --tags` returns a version string like '5.2-36-g15f7925'
when on commit g15f7925, which is 36 commits after the tag 5.2.
This is a more clear version when between releases.
This commit is contained in:
Andrew Archibald 2021-02-15 14:37:28 -07:00 committed by Nikita Prokopov
parent e2e526c971
commit 888580a05a
2 changed files with 4 additions and 16 deletions

View File

@ -5,3 +5,6 @@ dep:
build:
docker run --rm -v ${PWD}:/opt fira:latest ./script/build
package:
./script/package

View File

@ -1,22 +1,7 @@
#!/bin/zsh -euo pipefail
cd "`dirname $0`/.."
setopt BASH_REMATCH
MAJOR=`cat FiraCode.glyphs | grep versionMajor`
VERSION=""
if [[ $MAJOR =~ 'versionMajor = ([0-9]+);' ]] ; then
VERSION="${BASH_REMATCH[2]}"
fi
MINOR=`cat FiraCode.glyphs | grep versionMinor`
if [[ $MINOR =~ 'versionMinor = ([0-9]+);' ]] ; then
MATCH="${BASH_REMATCH[2]}"
if [ "$MATCH" != "0" ] ; then
VERSION="$VERSION.$MATCH"
fi
fi
VERSION="$(git describe --tags)"
FILE="Fira_Code_v$VERSION.zip"
rm -f $FILE