Handle non-versioned annotated tags gracefully when building a Ubuntu .deb package (#4375)

This commit is contained in:
Wissididom 2023-02-13 22:39:59 +01:00 committed by GitHub
parent bb0b563a87
commit 4cb8403491
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,9 +40,10 @@ if [ ! -f ./bin/chatterino ] || [ ! -x ./bin/chatterino ]; then
exit 1
fi
chatterino_version=$(git describe 2>/dev/null | cut -c 2-) || true
if [ -z "$chatterino_version" ]; then
# Fall back to this in case the build happened outside of a git repo or a repo without tags
chatterino_version=$(git describe 2>/dev/null) || true
if [ "$(echo "$chatterino_version" | cut -c1-1)" = 'v' ]; then
chatterino_version="$(echo "$chatterino_version" | cut -c2-)"
else
chatterino_version="0.0.0-dev"
fi