Skip to content

Commit 3caf1b2

Browse files
authored
feat(code-server): link binary to PATH (#415)
Noticed we don't place `code-server` in path, so made a quick fix.
1 parent fd5dd37 commit 3caf1b2

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

code-server/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Automatically install [code-server](https://github.com/coder/code-server) in a w
1515
module "code-server" {
1616
count = data.coder_workspace.me.start_count
1717
source = "registry.coder.com/modules/code-server/coder"
18-
version = "1.0.29"
18+
version = "1.0.31"
1919
agent_id = coder_agent.example.id
2020
}
2121
```
@@ -30,7 +30,7 @@ module "code-server" {
3030
module "code-server" {
3131
count = data.coder_workspace.me.start_count
3232
source = "registry.coder.com/modules/code-server/coder"
33-
version = "1.0.29"
33+
version = "1.0.31"
3434
agent_id = coder_agent.example.id
3535
install_version = "4.8.3"
3636
}
@@ -44,7 +44,7 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
4444
module "code-server" {
4545
count = data.coder_workspace.me.start_count
4646
source = "registry.coder.com/modules/code-server/coder"
47-
version = "1.0.29"
47+
version = "1.0.31"
4848
agent_id = coder_agent.example.id
4949
extensions = [
5050
"dracula-theme.theme-dracula"
@@ -62,7 +62,7 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
6262
module "code-server" {
6363
count = data.coder_workspace.me.start_count
6464
source = "registry.coder.com/modules/code-server/coder"
65-
version = "1.0.29"
65+
version = "1.0.31"
6666
agent_id = coder_agent.example.id
6767
extensions = ["dracula-theme.theme-dracula"]
6868
settings = {
@@ -79,7 +79,7 @@ Just run code-server in the background, don't fetch it from GitHub:
7979
module "code-server" {
8080
count = data.coder_workspace.me.start_count
8181
source = "registry.coder.com/modules/code-server/coder"
82-
version = "1.0.29"
82+
version = "1.0.31"
8383
agent_id = coder_agent.example.id
8484
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
8585
}
@@ -95,7 +95,7 @@ Run an existing copy of code-server if found, otherwise download from GitHub:
9595
module "code-server" {
9696
count = data.coder_workspace.me.start_count
9797
source = "registry.coder.com/modules/code-server/coder"
98-
version = "1.0.29"
98+
version = "1.0.31"
9999
agent_id = coder_agent.example.id
100100
use_cached = true
101101
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
@@ -108,7 +108,7 @@ Just run code-server in the background, don't fetch it from GitHub:
108108
module "code-server" {
109109
count = data.coder_workspace.me.start_count
110110
source = "registry.coder.com/modules/code-server/coder"
111-
version = "1.0.29"
111+
version = "1.0.31"
112112
agent_id = coder_agent.example.id
113113
offline = true
114114
}

code-server/run.sh

+10
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ fi
4242
if [ ! -f "$CODE_SERVER" ] || [ "${USE_CACHED}" != true ]; then
4343
printf "$${BOLD}Installing code-server!\n"
4444

45+
# Clean up from other install (in case install prefix changed).
46+
if [ -n "$CODER_SCRIPT_BIN_DIR" ] && [ -e "$CODER_SCRIPT_BIN_DIR/code-server" ]; then
47+
rm "$CODER_SCRIPT_BIN_DIR/code-server"
48+
fi
49+
4550
ARGS=(
4651
"--method=standalone"
4752
"--prefix=${INSTALL_PREFIX}"
@@ -58,6 +63,11 @@ if [ ! -f "$CODE_SERVER" ] || [ "${USE_CACHED}" != true ]; then
5863
printf "🥳 code-server has been installed in ${INSTALL_PREFIX}\n\n"
5964
fi
6065

66+
# Make the code-server available in PATH.
67+
if [ -n "$CODER_SCRIPT_BIN_DIR" ] && [ ! -e "$CODER_SCRIPT_BIN_DIR/code-server" ]; then
68+
ln -s "$CODE_SERVER" "$CODER_SCRIPT_BIN_DIR/code-server"
69+
fi
70+
6171
# Get the list of installed extensions...
6272
LIST_EXTENSIONS=$($CODE_SERVER --list-extensions $EXTENSION_ARG)
6373
readarray -t EXTENSIONS_ARRAY <<< "$LIST_EXTENSIONS"

0 commit comments

Comments
 (0)