mirror of
https://github.com/hassio-addons/addon-vscode.git
synced 2025-05-07 04:31:24 +00:00
✨ Adds Hassio Ingress support + General refactor
This commit is contained in:
parent
5b716764fa
commit
2d030869ee
29 changed files with 321 additions and 248 deletions
37
vscode/rootfs/etc/cont-init.d/code-server.sh
Normal file
37
vscode/rootfs/etc/cont-init.d/code-server.sh
Normal file
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Visual Studio Code
|
||||
# Sets up code-server.
|
||||
# ==============================================================================
|
||||
|
||||
# Ensure persistent data folder exists
|
||||
if ! bashio::fs.directory_exists '/data/vscode'; then
|
||||
mkdir -p /data/vscode/extensions \
|
||||
|| bashio::exit.nok "Could not create persistent storage folder."
|
||||
fi
|
||||
|
||||
# Copy in the extensions we deliver
|
||||
cp -R /root/.code-server/extensions/* /data/vscode/extensions
|
||||
|
||||
# Sets up default user settings on first start.
|
||||
if ! bashio::fs.file_exists '/data/vscode/User/settings.json'; then
|
||||
mkdir -p /data/vscode/User \
|
||||
|| bashio::exit.nok "Could not create persistent storage folder."
|
||||
|
||||
cp /root/.code-server/settings.json /data/vscode/User/settings.json
|
||||
fi
|
||||
|
||||
# Workaround workspace bug for code-server
|
||||
# https://github.com/codercom/code-server/issues/121
|
||||
if ! bashio::fs.file_exists '/data/vscode/Backups/workspaces.json'; then
|
||||
mkdir -p /data/vscode/Backups \
|
||||
|| bashio::exit.nok "Could not create persistent storage folder."
|
||||
cp /root/.code-server/workspaces.json /data/vscode/Backups/workspaces.json
|
||||
fi
|
||||
|
||||
# Workaround workspace bug for code-server (same as above, part 2)
|
||||
# https://github.com/codercom/code-server/issues/121
|
||||
if ! bashio::fs.file_exists '/data/vscode/User/workspaceStorage'; then
|
||||
mkdir -p /data/vscode/User/workspaceStorage \
|
||||
|| bashio::exit.nok "Could not create persistent storage folder."
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue