@@ -25,36 +25,37 @@ if [ ! -f ~/.local/share/code-server/User/settings.json ]; then
25
25
echo " ${SETTINGS} " > ~ /.local/share/code-server/User/settings.json
26
26
fi
27
27
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
31
31
echo " 🥳 Found a copy of code-server"
32
32
run_code_server
33
33
exit 0
34
34
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
38
36
echo " Failed to find a copy of code-server"
39
37
exit 1
40
38
fi
41
39
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"
43
43
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
51
51
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"
56
58
fi
57
- printf " 🥳 code-server has been installed in ${INSTALL_PREFIX} \n\n"
58
59
59
60
# Install each extension...
60
61
IFS=' ,' read -r -a EXTENSIONLIST <<< " $${EXTENSIONS}"
0 commit comments