This commit is contained in:
Richard Sperry 2025-04-16 22:17:04 -07:00
parent 3edc1d42ad
commit 1839f5193a
2 changed files with 6 additions and 5 deletions

View file

@ -22,7 +22,7 @@ readonly -a PREVIOUS_DEFAULT_CONFIG_HASHES=(
dbe905f0935b2fea8bb5ba379bff78db9d056ea6d0965c68aa9b07938a52cbbf117186452b2b6c766aa4cf93cc3494ad91b763e8500e515e41d8cde31a3821ae dbe905f0935b2fea8bb5ba379bff78db9d056ea6d0965c68aa9b07938a52cbbf117186452b2b6c766aa4cf93cc3494ad91b763e8500e515e41d8cde31a3821ae
2212babaa9dc46d38ba239052c9c05151abe517cc8b493d0d351a96bf70c1efa4f7479f6ed0b75811429ba649906eb5657d73b0732b460e718a5c66603dcdbda 2212babaa9dc46d38ba239052c9c05151abe517cc8b493d0d351a96bf70c1efa4f7479f6ed0b75811429ba649906eb5657d73b0732b460e718a5c66603dcdbda
) )
DEFAULT_CONFIG_PATH="/data/vscode"
CODE_SERVER_CONFIG="$DEFAULT_CONFIG_PATH/config.yaml" CODE_SERVER_CONFIG="$DEFAULT_CONFIG_PATH/config.yaml"
# shellcheck source=../paths.sh # shellcheck source=../paths.sh
@ -80,10 +80,12 @@ setup_code_workspace() {
setup_config_path() { setup_config_path() {
# Ensure config path exists # Ensure config path exists
if bashio::config.has_value "vscode_config_path"; then if bashio::config.has_value "vscode_config_path"; then
DEFAULT_CONFIG_PATH=$(bashio::config 'vscode_config_path') temp_path=$(bashio::config 'vscode_config_path')
if ! bashio::fs.directory_exists "${DEFAULT_CONFIG_PATH}"; then if ! bashio::fs.directory_exists "${temp_path}"; then
bashio::exit.nok "Configured config path does not exist" bashio::exit.nok "Configured config path does not exist"
fi fi
export CODE_SERVER_CONFIG=$temp_path
else else
# otherwise set to local dir # otherwise set to local dir
if ! bashio::fs.directory_exists "$DEFAULT_CONFIG_PATH"; then if ! bashio::fs.directory_exists "$DEFAULT_CONFIG_PATH"; then
@ -92,7 +94,6 @@ setup_config_path() {
bashio::exit.nok "Could not create persistent storage folder." bashio::exit.nok "Could not create persistent storage folder."
fi fi
fi fi
bashio::log.info "using code-server config path: $CODE_SERVER_CONFIG" bashio::log.info "using code-server config path: $CODE_SERVER_CONFIG"
} }

View file

@ -2,7 +2,7 @@
# 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"
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
readonly CODE_SERVER_EXTENSIONS_INSTALL_PATH="$DEFAULT_CONFIG_PATH/extensions" readonly CODE_SERVER_EXTENSIONS_INSTALL_PATH="$DEFAULT_CONFIG_PATH/extensions"