mirror of
https://github.com/hassio-addons/addon-vscode.git
synced 2025-05-03 18:51:23 +00:00
devenv
This commit is contained in:
parent
cf37c9c8fd
commit
3edc1d42ad
4 changed files with 13 additions and 8 deletions
|
@ -12,5 +12,4 @@ export HASS_TOKEN="${SUPERVISOR_TOKEN:-}"
|
||||||
|
|
||||||
|
|
||||||
# Run the code server
|
# Run the code server
|
||||||
cd "$CODE_SERVER_WORKSPACE_DIR" || bashio::exit.nok "Workspace path does not exist"
|
|
||||||
exec code-server "$CODE_SERVER_WORKSPACE_FILE"
|
exec code-server "$CODE_SERVER_WORKSPACE_FILE"
|
||||||
|
|
|
@ -22,13 +22,18 @@ readonly -a PREVIOUS_DEFAULT_CONFIG_HASHES=(
|
||||||
dbe905f0935b2fea8bb5ba379bff78db9d056ea6d0965c68aa9b07938a52cbbf117186452b2b6c766aa4cf93cc3494ad91b763e8500e515e41d8cde31a3821ae
|
dbe905f0935b2fea8bb5ba379bff78db9d056ea6d0965c68aa9b07938a52cbbf117186452b2b6c766aa4cf93cc3494ad91b763e8500e515e41d8cde31a3821ae
|
||||||
2212babaa9dc46d38ba239052c9c05151abe517cc8b493d0d351a96bf70c1efa4f7479f6ed0b75811429ba649906eb5657d73b0732b460e718a5c66603dcdbda
|
2212babaa9dc46d38ba239052c9c05151abe517cc8b493d0d351a96bf70c1efa4f7479f6ed0b75811429ba649906eb5657d73b0732b460e718a5c66603dcdbda
|
||||||
)
|
)
|
||||||
|
DEFAULT_CONFIG_PATH="/data/vscode"
|
||||||
|
CODE_SERVER_CONFIG="$DEFAULT_CONFIG_PATH/config.yaml"
|
||||||
|
|
||||||
source "../paths.sh"
|
# shellcheck source=../paths.sh
|
||||||
|
source "/etc/s6-overlay/s6-rc.d/paths.sh"
|
||||||
run() {
|
run() {
|
||||||
setup_code_workspace
|
|
||||||
setup_clean_view
|
|
||||||
setup_config_path
|
setup_config_path
|
||||||
setup_config_files
|
setup_config_files
|
||||||
|
|
||||||
|
setup_code_workspace
|
||||||
|
setup_clean_view
|
||||||
|
|
||||||
set_log_level
|
set_log_level
|
||||||
set_user_settings
|
set_user_settings
|
||||||
setup_extensions
|
setup_extensions
|
||||||
|
@ -49,6 +54,7 @@ setup_clean_view() {
|
||||||
setup_code_workspace() {
|
setup_code_workspace() {
|
||||||
# Create the workspace dir
|
# Create the workspace dir
|
||||||
if [ ! -d "$CODE_SERVER_WORKSPACE_DIR" ]; then
|
if [ ! -d "$CODE_SERVER_WORKSPACE_DIR" ]; then
|
||||||
|
bashio::log.warning "CODE_SERVER_WORKSPACE_DIR does not exist. Creating..."
|
||||||
mkdir -p "$CODE_SERVER_WORKSPACE_DIR"
|
mkdir -p "$CODE_SERVER_WORKSPACE_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -60,12 +66,13 @@ setup_code_workspace() {
|
||||||
|
|
||||||
# .vscode dir
|
# .vscode dir
|
||||||
if [ ! -d "$CODE_SERVER_VSCODE_DIR" ]; then
|
if [ ! -d "$CODE_SERVER_VSCODE_DIR" ]; then
|
||||||
|
bashio::log.warning "CODE_SERVER_VSCODE_DIR does not exist. Creating..."
|
||||||
mkdir -p "$CODE_SERVER_VSCODE_DIR"
|
mkdir -p "$CODE_SERVER_VSCODE_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# tasks.json
|
# tasks.json
|
||||||
if [ ! -e "$CODE_SERVER_VSCODE_TASKS" ]; then
|
if [ ! -e "$CODE_SERVER_VSCODE_TASKS" ]; then
|
||||||
bashio::log.warning "CODE_SERVER_WORKSPACE_FILE does not exist. Creating..."
|
bashio::log.warning "CODE_SERVER_VSCODE_TASKS does not exist. Creating..."
|
||||||
cp "$DEFAULT_FILES_PATH/vscode/tasks.json" "$CODE_SERVER_VSCODE_TASKS"
|
cp "$DEFAULT_FILES_PATH/vscode/tasks.json" "$CODE_SERVER_VSCODE_TASKS"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
# Sets up code-server.
|
# Sets up code-server.
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
bashio::log.info "Initalizing code-server configs"
|
bashio::log.info "Initalizing code-server configs"
|
||||||
source "../paths.sh"
|
# shellcheck source=../paths.sh
|
||||||
|
source "/etc/s6-overlay/s6-rc.d/paths.sh"
|
||||||
# List of previous config hashes, to allow upgrade "default" configs.
|
# List of previous config hashes, to allow upgrade "default" configs.
|
||||||
readonly CUSTOM_BASH_SCRIPTS_PATH="/data/custom"
|
readonly CUSTOM_BASH_SCRIPTS_PATH="/data/custom"
|
||||||
readonly DEFAULT_FILES_PATH="/var/lib/code-server/defaults/core"
|
readonly DEFAULT_FILES_PATH="/var/lib/code-server/defaults/core"
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
# this file is to prevent spagetti paths
|
# this file is to prevent spagetti paths
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
|
|
||||||
DEFAULT_CONFIG_PATH="/data/vscode"
|
|
||||||
CODE_SERVER_CONFIG="$DEFAULT_CONFIG_PATH/config.yaml"
|
|
||||||
|
|
||||||
readonly DEFAULT_FILES_PATH="/var/lib/code-server/defaults"
|
readonly DEFAULT_FILES_PATH="/var/lib/code-server/defaults"
|
||||||
readonly ROOT_CODE_SERVER_CONFIG_PATH="/root/.config/code-server/" # needed for code-server to cleanly
|
readonly ROOT_CODE_SERVER_CONFIG_PATH="/root/.config/code-server/" # needed for code-server to cleanly
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue