directly install vscode-server
							parent
							
								
									03e55b361e
								
							
						
					
					
						commit
						e22a7188e1
					
				@ -0,0 +1,17 @@
 | 
			
		||||
#!/usr/bin/env sh
 | 
			
		||||
 | 
			
		||||
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)
 | 
			
		||||
if [ $? -ne 0 ]; then
 | 
			
		||||
  echo "Failed to install vscode-server: $output"
 | 
			
		||||
  exit 1
 | 
			
		||||
fi
 | 
			
		||||
printf "🥳 vscode-server has been installed.\n\n"
 | 
			
		||||
 | 
			
		||||
echo "👷 Running ${INSTALL_DIR}/bin/code serve-web --port ${PORT} --without-connection-token --accept-server-license-terms in the background..."
 | 
			
		||||
echo "Check logs at ${LOG_PATH}!"
 | 
			
		||||
${INSTALL_DIR}/bin/code-server serve-local --port ${PORT} --without-connection-token --accept-server-license-terms >${LOG_PATH} 2>&1 &
 | 
			
		||||
@ -1,23 +0,0 @@
 | 
			
		||||
#!/usr/bin/env sh
 | 
			
		||||
 | 
			
		||||
BOLD='\033[0;1m'
 | 
			
		||||
 | 
			
		||||
# Check if VS Code is installed
 | 
			
		||||
if [ ! -d "${INSTALL_DIR}" ]; then
 | 
			
		||||
  printf "$${BOLD} Installing VS Code!\n"
 | 
			
		||||
  # Download and extract VS Code tarball
 | 
			
		||||
  output=$(curl -L "https://update.code.visualstudio.com/latest/linux-x64/stable" -o /tmp/code.tar.gz &&
 | 
			
		||||
    mkdir -p ${INSTALL_DIR} &&
 | 
			
		||||
    tar -xzf /tmp/code.tar.gz -C ${INSTALL_DIR} --strip-components=1)
 | 
			
		||||
  if [ $? -ne 0 ]; then
 | 
			
		||||
    echo "Failed to install VS Code: $output"
 | 
			
		||||
    exit 1
 | 
			
		||||
  fi
 | 
			
		||||
  printf "🥳 VS code has been installed.\n\n"
 | 
			
		||||
else
 | 
			
		||||
  printf "🥳 VS code is already installed.\n\n"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "👷 Running code serve-web in the background..."
 | 
			
		||||
echo "Check logs at ${LOG_PATH}!"
 | 
			
		||||
${INSTALL_DIR}/bin/code serve-web --port ${PORT} --without-connection-token --accept-server-license-terms >${LOG_PATH} 2>&1 &
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue