Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

code-server: fix multiple-extension installation #90

Merged
merged 19 commits into from
Oct 13, 2023
Merged
12 changes: 12 additions & 0 deletions code-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ module "settings" {
}
```

### Install multiple extensions

Just run code-server in the background, don't fetch it from GitHub:

```hcl
module "settings" {
source = "https://registry.coder.com/modules/code-server"
agent_id = coder_agent.example.id
extensions = [ "dracula-theme.theme-dracula", "ms-azuretools.vscode-docker" ]
}
```

### Offline Mode

Just run code-server in the background, don't fetch it from GitHub:
Expand Down
5 changes: 3 additions & 2 deletions code-server/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ printf "🥳 code-server has been installed in ${INSTALL_PREFIX}\n\n"
CODE_SERVER="${INSTALL_PREFIX}/bin/code-server"

# Install each extension...
for extension in "$${EXTENSIONS[@]}"; do
IFS=',' read -r -a EXTENSIONLIST <<< "$${EXTENSIONS}"
for extension in "$${EXTENSIONLIST[@]}"; do
if [ -z "$extension" ]; then
continue
fi
Expand All @@ -46,4 +47,4 @@ fi

echo "👷 Running code-server in the background..."
echo "Check logs at ${LOG_PATH}!"
$CODE_SERVER --auth none --port ${PORT} >${LOG_PATH} 2>&1 &
$CODE_SERVER --auth none --port ${PORT} >${LOG_PATH} 2>&1 &