diff --git a/check-version.sh b/check-version.sh index bbe20ba..a609407 100644 --- a/check-version.sh +++ b/check-version.sh @@ -1,8 +1,9 @@ #!/bin/bash -URL="https://www.cpan.org/src/README.html" +# Get version using the MetaCPAN Rest API +VERSION=$(curl -s -L https://fastapi.metacpan.org/download_url/perl | jq -r '.release') -# Get version number from website -VERSION=$(curl -s -L "$URL" | grep -A2 'class="latest"' | tail -n1 | grep -o -E '[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}') +# Trim prefix +VERSION=${VERSION//perl-/} echo "$VERSION"