From c57044745e08f2db026844ed9e44818ae860c407 Mon Sep 17 00:00:00 2001 From: Florent Benoit Date: Mon, 26 Jul 2021 12:26:37 +0200 Subject: [PATCH] fix(vsix-installer): Should handle relative URLs https://github.com/eclipse/che/issues/20198 Change-Id: I79f8c23ccf7e7b89fdb9a732c3e1814e99bdac20 Signed-off-by: Florent Benoit --- dockerfiles/theia-vsix-installer/src/entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dockerfiles/theia-vsix-installer/src/entrypoint.sh b/dockerfiles/theia-vsix-installer/src/entrypoint.sh index 22b38e79b..afc54b260 100755 --- a/dockerfiles/theia-vsix-installer/src/entrypoint.sh +++ b/dockerfiles/theia-vsix-installer/src/entrypoint.sh @@ -20,6 +20,12 @@ for container in $(echo "$WORKSPACE" | sed -e 's|[[,]\({"attributes":{"app.kuber mkdir -p "$dest" unset IFS for url in $(echo "$urls" | sed 's/[",]/ /g' - ); do + # check if URL starts with relative:extension/ + # example of url: "relative:extension/resources/download_jboss_org/jbosstools/static/jdt_ls/stable/java-0.75.0-60.vsix + if [[ "$url" =~ ^relative:extension/.* ]]; then + # update URL by using the Plugin Registry URL as prefix + url=${CHE_PLUGIN_REGISTRY_URL}/${url#relative:extension/} + fi echo; echo "downloading $urls to $dest" curl -L "$url" > "$dest/$(basename "$url")" done