Update check-version.sh script

This commit is contained in:
2025-08-21 10:08:12 +03:00
parent 05271e9cb0
commit 12fff1b023
+3 -9
View File
@@ -7,15 +7,9 @@ REPO="pulseaudio/pulseaudio"
REPO=$(echo "$REPO" | sed 's|/|%2F|g')
# Get tag name using Gitlab Rest API
TAG_NAME=$(curl -s -L https://gitlab.freedesktop.org/api/v4/projects/"$REPO"/repository/tags | jq -r '.[0].name')
TAG_NAME=$(curl -s -L https://gitlab.freedesktop.org/api/v4/projects/"$REPO"/repository/tags | jq -r '.[].name' | sort -r | head -n1)
# Trim '-gitlab' suffix
TAG_NAME=$(echo "$TAG_NAME" | sed 's/-gitlab//g')
# Get version number from tag name
VERSION=$(echo "$TAG_NAME" | rev | cut -d'-' -f1 | rev)
# Trim 'v' character in VERSION variable
VERSION=$(echo "$VERSION" | tr -d 'v')
# Trim 'v' character in TAG_NAME variable
VERSION=$(echo "$TAG_NAME" | tr -d 'v')
echo "$VERSION"