Last active
May 5, 2020 09:15
-
-
Save bdelacretaz/b1a9f13d6ebe60348076ffe1b2e6cebc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# List all versions of Sling modules from a Maven repository | |
# ..just a ugly hack, we should use more solid parsing, or the Maven repository API | |
# | |
BASE_URL="https://repo1.maven.org/maven2/org/apache/sling/" | |
EGREP_FILTER= | |
curl -s $BASE_URL | grep 'a href' | egrep -v '\.\./|maven-metadata' | cut -d'"' -f2 | while read mod | |
do | |
curl -s ${BASE_URL}${mod} | grep 'a href' | egrep -v '\.\./|maven-metadata' | while read line | |
do | |
V=$(echo $line | cut -d'"' -f2) | |
D=$(echo $line | sed 's/.*a>//' | sed 's/^ *//' | cut -d' ' -f1) | |
echo "$mod $V $D" | |
done | sort | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment