From 2a180b0776069c7b74c476d9adf4490083303abb Mon Sep 17 00:00:00 2001 From: Brett Logan Date: Sun, 8 May 2022 22:18:15 -0400 Subject: [PATCH] Use canonical method to retrieve Jar file --- Dockerfile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index b4ca04df..8d27ab5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -244,19 +244,14 @@ RUN apk add --no-cache rakudo zef \ ###################### # Install CheckStyle # ###################### - && CHECKSTYLE_LATEST=$(curl -s https://api.github.com/repos/checkstyle/checkstyle/releases/latest \ - | grep browser_download_url \ - | grep ".jar" \ - | cut -d '"' -f 4) \ - && curl --retry 5 --retry-delay 5 -sSL "$CHECKSTYLE_LATEST" \ + && curl --retry 5 --retry-delay 5 -sSL \ + "$(curl -s https://api.github.com/repos/checkstyle/checkstyle/releases/latest | jq -r '.assets[0].browser_download_url')" \ --output /usr/bin/checkstyle \ ############################## # Install google-java-format # ############################## - && GOOGLE_JAVA_FORMAT_VERSION=$(curl -s https://github.com/google/google-java-format/releases/latest \ - | cut -d '"' -f 2 | cut -d '/' -f 8 | sed -e 's/v//g') \ && curl --retry 5 --retry-delay 5 -sSL \ - "https://github.com/google/google-java-format/releases/download/v$GOOGLE_JAVA_FORMAT_VERSION/google-java-format-$GOOGLE_JAVA_FORMAT_VERSION-all-deps.jar" \ + "$(curl -s https://api.github.com/repos/google/google-java-format/releases/latest | jq -r '.assets | .[] | select(.browser_download_url | contains("all-deps.jar")) | .browser_download_url')" \ --output /usr/bin/google-java-format \ ################################# # Install luacheck and luarocks #