addon-vscode/vscode/rootfs/etc/services.d/code/run
2020-02-15 16:30:55 +01:00

27 lines
858 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 1337)
options+=(--user-data-dir "/data/vscode")
options+=(--extensions-dir "/data/vscode/extensions")
options+=(--host 0.0.0.0)
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://supervisor/core"
export HASS_TOKEN="${SUPERVISOR_TOKEN:-}"
# Run the code server
exec code-server "${options[@]}" /config