mirror of
https://github.com/hassio-addons/addon-vscode.git
synced 2025-05-03 18:51:23 +00:00
27 lines
858 B
Text
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
|