Skip to content

Commit 4021d85

Browse files
fix(code-server): USE_CACHED should still install extensions (#252)
1 parent 72eaf8a commit 4021d85

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

code-server/run.sh

+20-19
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,37 @@ if [ ! -f ~/.local/share/code-server/User/settings.json ]; then
2525
echo "${SETTINGS}" > ~/.local/share/code-server/User/settings.json
2626
fi
2727

28-
# Check if code-server is already installed for offline or cached mode
29-
if [ -f "$CODE_SERVER" ]; then
30-
if [ "${OFFLINE}" = true ] || [ "${USE_CACHED}" = true ]; then
28+
# Check if code-server is already installed for offline
29+
if [ "${OFFLINE}" = true ]; then
30+
if [ -f "$CODE_SERVER" ]; then
3131
echo "🥳 Found a copy of code-server"
3232
run_code_server
3333
exit 0
3434
fi
35-
fi
36-
# Offline mode always expects a copy of code-server to be present
37-
if [ "${OFFLINE}" = true ]; then
35+
# Offline mode always expects a copy of code-server to be present
3836
echo "Failed to find a copy of code-server"
3937
exit 1
4038
fi
4139

42-
printf "$${BOLD}Installing code-server!\n"
40+
# If there is no cached install OR we don't want to use a cached install
41+
if [ ! -f "$CODE_SERVER" ] || [ "${USE_CACHED}" != true ]; then
42+
printf "$${BOLD}Installing code-server!\n"
4343

44-
ARGS=(
45-
"--method=standalone"
46-
"--prefix=${INSTALL_PREFIX}"
47-
)
48-
if [ -n "${VERSION}" ]; then
49-
ARGS+=("--version=${VERSION}")
50-
fi
44+
ARGS=(
45+
"--method=standalone"
46+
"--prefix=${INSTALL_PREFIX}"
47+
)
48+
if [ -n "${VERSION}" ]; then
49+
ARGS+=("--version=${VERSION}")
50+
fi
5151

52-
output=$(curl -fsSL https://code-server.dev/install.sh | sh -s -- "$${ARGS[@]}")
53-
if [ $? -ne 0 ]; then
54-
echo "Failed to install code-server: $output"
55-
exit 1
52+
output=$(curl -fsSL https://code-server.dev/install.sh | sh -s -- "$${ARGS[@]}")
53+
if [ $? -ne 0 ]; then
54+
echo "Failed to install code-server: $output"
55+
exit 1
56+
fi
57+
printf "🥳 code-server has been installed in ${INSTALL_PREFIX}\n\n"
5658
fi
57-
printf "🥳 code-server has been installed in ${INSTALL_PREFIX}\n\n"
5859

5960
# Install each extension...
6061
IFS=',' read -r -a EXTENSIONLIST <<< "$${EXTENSIONS}"

0 commit comments

Comments
 (0)