Files
gpgmepp/check-version.sh
2025-09-16 16:44:33 +03:00

13 lines
329 B
Bash

#!/bin/bash
# Git repository
REPO="git://git.gnupg.org/gpgmepp.git"
# Get tag name using 'git ls-remote'
TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | cut -d'/' -f3 | grep -E '^gpgmepp-[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}' | tail -n1)
# Trim prefix
VERSION=${TAG_NAME//gpgmepp-/}
echo "$VERSION"