fix(code-server): USE_CACHED should still install extensions (#252)
This commit is contained in:
@@ -25,36 +25,37 @@ if [ ! -f ~/.local/share/code-server/User/settings.json ]; then
|
|||||||
echo "${SETTINGS}" > ~/.local/share/code-server/User/settings.json
|
echo "${SETTINGS}" > ~/.local/share/code-server/User/settings.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if code-server is already installed for offline or cached mode
|
# Check if code-server is already installed for offline
|
||||||
if [ -f "$CODE_SERVER" ]; then
|
if [ "${OFFLINE}" = true ]; then
|
||||||
if [ "${OFFLINE}" = true ] || [ "${USE_CACHED}" = true ]; then
|
if [ -f "$CODE_SERVER" ]; then
|
||||||
echo "🥳 Found a copy of code-server"
|
echo "🥳 Found a copy of code-server"
|
||||||
run_code_server
|
run_code_server
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
# Offline mode always expects a copy of code-server to be present
|
||||||
# Offline mode always expects a copy of code-server to be present
|
|
||||||
if [ "${OFFLINE}" = true ]; then
|
|
||||||
echo "Failed to find a copy of code-server"
|
echo "Failed to find a copy of code-server"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "$${BOLD}Installing code-server!\n"
|
# If there is no cached install OR we don't want to use a cached install
|
||||||
|
if [ ! -f "$CODE_SERVER" ] || [ "${USE_CACHED}" != true ]; then
|
||||||
|
printf "$${BOLD}Installing code-server!\n"
|
||||||
|
|
||||||
ARGS=(
|
ARGS=(
|
||||||
"--method=standalone"
|
"--method=standalone"
|
||||||
"--prefix=${INSTALL_PREFIX}"
|
"--prefix=${INSTALL_PREFIX}"
|
||||||
)
|
)
|
||||||
if [ -n "${VERSION}" ]; then
|
if [ -n "${VERSION}" ]; then
|
||||||
ARGS+=("--version=${VERSION}")
|
ARGS+=("--version=${VERSION}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
output=$(curl -fsSL https://code-server.dev/install.sh | sh -s -- "$${ARGS[@]}")
|
output=$(curl -fsSL https://code-server.dev/install.sh | sh -s -- "$${ARGS[@]}")
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Failed to install code-server: $output"
|
echo "Failed to install code-server: $output"
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
printf "🥳 code-server has been installed in ${INSTALL_PREFIX}\n\n"
|
||||||
fi
|
fi
|
||||||
printf "🥳 code-server has been installed in ${INSTALL_PREFIX}\n\n"
|
|
||||||
|
|
||||||
# Install each extension...
|
# Install each extension...
|
||||||
IFS=',' read -r -a EXTENSIONLIST <<< "$${EXTENSIONS}"
|
IFS=',' read -r -a EXTENSIONLIST <<< "$${EXTENSIONS}"
|
||||||
|
|||||||
Reference in New Issue
Block a user