From 07a0003c35967dad4d545f28c1542d839ad708c2 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Mon, 25 Sep 2023 17:38:35 +0300 Subject: [PATCH] fixup --- vscode-server/run.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/vscode-server/run.sh b/vscode-server/run.sh index aa551f5..c8a1bbe 100644 --- a/vscode-server/run.sh +++ b/vscode-server/run.sh @@ -2,10 +2,17 @@ BOLD='\033[0;1m' -printf "$${BOLD} Installing vscode-server!\n" -# Download and extract vsode-server tarball -HASH=$(curl https://update.code.visualstudio.com/api/commits/stable/server-linux-x64-web | cut -d '"' -f 2) -output=$(wget -O- https://az764295.vo.msecnd.net/stable/$HASH/vscode-server-linux-x64-web.tar.gz | tar -xz -C ${INSTALL_DIR} --strip-components=1 >/dev/null 2>&1) +# Create install directory if it doesn't exist +mkdir -p ${INSTALL_DIR} + +printf "$${BOLD}Installing vscode-server!\n" +# Fetch the latest commit hash for stable release +HASH=$(curl -s https://update.code.visualstudio.com/api/commits/stable/server-linux-x64-web | cut -d '"' -f 2) + +# Download and extract vscode-server tarball +output=$(wget -O /tmp/vscode-server-linux-x64-web.tar.gz https://az764295.vo.msecnd.net/stable/$HASH/vscode-server-linux-x64-web.tar.gz && + tar -xzf /tmp/vscode-server-linux-x64-web.tar.gz -C ${INSTALL_DIR} --strip-components=1) + if [ $? -ne 0 ]; then echo "Failed to install vscode-server: $output" exit 1