Update check-version.sh script
This commit is contained in:
+7
-8
@@ -1,15 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Gitlab repository
|
URL="https://spice-space.org/download/gtk"
|
||||||
REPO="spice/spice-gtk"
|
|
||||||
|
|
||||||
# Replace slash with URL encoded representation
|
# Get version number from tag name
|
||||||
REPO=$(echo "$REPO" | sed 's|/|%2F|g')
|
VERSION=$(curl -s -L "$URL" | grep -o -P 'spice-gtk-\d\.\d+.tar.xz' | tail -n1)
|
||||||
|
|
||||||
# Get tag name using Gitlab Rest API
|
# Trim prefix
|
||||||
TAG_NAME=$(curl -s -L https://gitlab.freedesktop.org/api/v4/projects/"$REPO"/repository/tags | jq -r '.[0].name')
|
VERSION=${VERSION//spice-gtk-}
|
||||||
|
|
||||||
# Trim 'v' character in TAG_NAME variable
|
# Trim suffix
|
||||||
VERSION=$(echo "$TAG_NAME" | tr -d 'v')
|
VERSION=${VERSION//.tar.xz}
|
||||||
|
|
||||||
echo "$VERSION"
|
echo "$VERSION"
|
||||||
|
|||||||
Reference in New Issue
Block a user