16 lines
357 B
Bash
16 lines
357 B
Bash
#!/bin/bash
|
|
|
|
# Pagure repository
|
|
REPO="newt"
|
|
|
|
# Get tag name using Pagure Rest API
|
|
TAG_NAME=$(curl -s -L https://pagure.io/api/0/"$REPO"/git/tags | jq -r '.tags[]' | grep '^r' | sort -V | tail -n1)
|
|
|
|
# Replace '-' character with '.'
|
|
VERSION="${TAG_NAME//-/.}"
|
|
|
|
# Trim 'r' character in VERSION variable
|
|
VERSION=$(echo "$VERSION" | tr -d 'r')
|
|
|
|
echo "$VERSION"
|