From 4cb8403491b2ab0d79f0875d691c335e62d75885 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 13 Feb 2023 22:39:59 +0100 Subject: [PATCH] Handle non-versioned annotated tags gracefully when building a Ubuntu .deb package (#4375) --- .CI/CreateUbuntuDeb.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.CI/CreateUbuntuDeb.sh b/.CI/CreateUbuntuDeb.sh index e13af828..9b89fddb 100755 --- a/.CI/CreateUbuntuDeb.sh +++ b/.CI/CreateUbuntuDeb.sh @@ -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