Files
mailcap/check-version.sh
T
2025-09-27 15:28:45 +03:00

16 lines
360 B
Bash

#!/bin/bash
# Pagure repository
REPO="mailcap"
# 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"