|
42 | 42 | fi
|
43 | 43 | fi
|
44 | 44 |
|
45 |
| -# # Check if code-server folder exists |
46 |
| -if [ ! -f "/opt/app-root/src/.local/share/code-server" ]; then |
| 45 | +# Ensure the extensions directory exists |
| 46 | +extensions_dir="/opt/app-root/src/.local/share/code-server/extensions" |
| 47 | +mkdir -p "$extensions_dir" |
47 | 48 |
|
48 |
| - # Check internet connection - this check is for disconected enviroments |
49 |
| - if curl -Is http://www.google.com | head -n 1 | grep -q "200 OK"; then |
50 |
| - # Internet connection is available |
51 |
| - echo "Internet connection available. Installing specific extensions." |
52 |
| - |
53 |
| - # Install specific extensions |
54 |
| - code-server --install-extension ${SCRIPT_DIR}/utils/ms-python.python-2024.2.1.vsix |
55 |
| - code-server --install-extension ${SCRIPT_DIR}/utils/ms-toolsai.jupyter-2023.9.100.vsix |
| 49 | +# Copy installed extensions to the runtime extensions directory if they do not already exist |
| 50 | +if [ -d "/opt/app-root/extensions-temp" ]; then |
| 51 | + for extension in /opt/app-root/extensions-temp/*/; |
| 52 | + do |
| 53 | + extension_folder=$(basename "$extension") |
| 54 | + if [ ! -d "$extensions_dir/$extension_folder" ]; then |
| 55 | + cp -r "$extension" "$extensions_dir" |
| 56 | + echo "Debug: Extension '$extension_folder' copied to runtime directory." |
56 | 57 | else
|
57 |
| - # No internet connection |
58 |
| - echo "No internet connection. Installing all extensions." |
59 |
| - |
60 |
| - # Install all extensions |
61 |
| - code-server --install-extension ${SCRIPT_DIR}/utils/ms-python.python-2024.2.1.vsix |
62 |
| - code-server --install-extension ${SCRIPT_DIR}/utils/ [email protected] |
63 |
| - code-server --install-extension ${SCRIPT_DIR}/utils/ms-toolsai.jupyter-2023.9.100.vsix |
64 |
| - code-server --install-extension ${SCRIPT_DIR}/utils/ms-toolsai.jupyter-keymap-1.1.2.vsix |
65 |
| - code-server --install-extension ${SCRIPT_DIR}/utils/ms-toolsai.jupyter-renderers-1.0.17.vsix |
66 |
| - code-server --install-extension ${SCRIPT_DIR}/utils/ms-toolsai.vscode-jupyter-cell-tags-0.1.8.vsix |
67 |
| - code-server --install-extension ${SCRIPT_DIR}/utils/ms-toolsai.vscode-jupyter-slideshow-0.1.5.vsix |
| 58 | + echo "Debug: Extension '$extension_folder' already exists in runtime directory, skipping." |
68 | 59 | fi
|
| 60 | + done |
| 61 | +else |
| 62 | + echo "Debug: Temporary extensions directory not found." |
| 63 | +fi |
| 64 | + |
| 65 | +# Ensure log directory exists |
| 66 | +logs_dir="/opt/app-root/src/.local/share/code-server/coder-logs" |
| 67 | +if [ ! -d "$logs_dir" ]; then |
| 68 | + echo "Debug: Log directory not found, creating '$logs_dir'..." |
| 69 | + mkdir -p "$logs_dir" |
69 | 70 | fi
|
70 | 71 |
|
71 | 72 | # Start server
|
|
0 commit comments