Trying to fix the download of the JAR

This commit is contained in:
Carlo Sciolla 2019-05-06 12:09:31 +02:00
parent bc13bd2bfb
commit 7353285fa1
No known key found for this signature in database
GPG Key ID: BA5D71E6F3C580C1
1 changed files with 2 additions and 2 deletions

View File

@ -10,11 +10,11 @@ OUTPUT_PATH="${CURRENT_PATH}/plantuml.jar"
VERSIONS_URL='https://search.maven.org/solrsearch/select?q=g:net.sourceforge.plantuml+AND+a:plantuml&core=gav&start=0&rows=1&wt=xml'
# Only match the contents of the version (name="v") XML tag
LATEST_VERSION="$(curl "${VERSIONS_URL}" | grep -oP) '(?<=<str name=\"v\">).*?(?=</str>)'"
LATEST_VERSION="$(curl -s "${VERSIONS_URL}" | grep -oP '(?<=<str name="v">).*(?=</str>)')"
# Compose the download link
DOWNLOAD_URL="https://search.maven.org/remotecontent?filepath=net/sourceforge/plantuml/plantuml/${LATEST_VERSION}/plantuml-${LATEST_VERSION}.jar"
# finally, download the JAR file
echo "Downloading PlantUML v${LATEST_VERSION} into ${OUTPUT_PATH}"
curl -so "${OUTPUT_PATH}" "${DOWNLOAD_URL}"
curl -so "${OUTPUT_PATH}" "${DOWNLOAD_URL}" 2>/dev/null