Update check-version.sh script
This commit is contained in:
+4
-3
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user