addon-vscode/vscode/rootfs/etc/services.d/code/run
Franck Nijhof 51d0f8f96d
🔨 Re-branding
2020-02-15 16:15:28 +01:00

27 lines
861 B
Text

#!/usr/bin/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Visual Studio Code
# Runs the code server
# ==============================================================================
declare -a options
bashio::log.info 'Starting the code server...'
options+=(--port 8443)
options+=(--user-data-dir "/data/vscode")
options+=(--extensions-dir "/data/vscode/extensions")
options+=(--host 127.0.0.1)
if bashio::config.true 'disable_telemetry'; then
options+=(--disable-telemetry)
fi
# Disable code authentication, we use HA authentication
options+=(--auth none)
# Export env variables for the Home Assistant extension
export HASS_SERVER="http://hassio/homeassistant"
export HASS_TOKEN="${HASSIO_TOKEN:-}"
# Run the code server
exec code-server "${options[@]}" /config