| #!/command/with-contenv bash |
| |
| set -e |
|
|
| echo "[custom-setup] Starting custom setup script (99-custom-setup.sh)..." |
|
|
| |
| |
| |
|
|
| EXTENSIONS_TO_INSTALL=( |
| "ms-python.python" |
| "dbaeumer.vscode-eslint" |
| ) |
|
|
| |
| |
| INSTALL_CMD="" |
| if command -v openvscode-server &> /dev/null; then |
| INSTALL_CMD="openvscode-server" |
| elif command -v code-server &> /dev/null; then |
| INSTALL_CMD="code-server" |
| fi |
|
|
| if [ -n "$INSTALL_CMD" ]; then |
| echo "[custom-setup] Found command: $INSTALL_CMD. Attempting to install extensions..." |
| for EXT_ID in "${EXTENSIONS_TO_INSTALL[@]}"; do |
| echo "[custom-setup] Installing extension: $EXT_ID" |
| if su -ls /bin/bash abc -c "$INSTALL_CMD --install-extension $EXT_ID --force"; then |
| echo "[custom-setup] Successfully installed $EXT_ID (or it was already installed)." |
| else |
| echo "[custom-setup] WARN: Failed to install extension $EXT_ID. Please try installing it manually from the VS Code UI." |
| fi |
| done |
| else |
| echo "[custom-setup] WARN: Neither 'openvscode-server' nor 'code-server' command found in PATH. Skipping automatic extension installation." |
| fi |
|
|
| echo "[custom-setup] Extension installation process finished." |
|
|
| |
|
|
| echo "[custom-setup] Custom setup script finished." |
|
|
|
|