This commit is contained in:
Richard Sperry 2025-04-16 19:48:29 -07:00
parent fb2722afde
commit 0e99d4af51
3 changed files with 6 additions and 8 deletions

View file

@ -16,4 +16,5 @@ readonly CODE_SERVER_WORKSPACE_FILE="$CODE_SERVER_WORKSPACE_DIR/SERVER.code-work
# Run the code server # Run the code server
echo CODE_SERVER_WORKSPACE_FILE "$CODE_SERVER_WORKSPACE_FILE" echo CODE_SERVER_WORKSPACE_FILE "$CODE_SERVER_WORKSPACE_FILE"
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"

View file

@ -56,15 +56,14 @@ setup_clean_view() {
} }
setup_code_workspace() { setup_code_workspace() {
# Set a link to where code-server expects the config to be # Create the workspace dir
if [ ! -d "$ROOT_CODE_SERVER_CONFIG_PATH" ]; then if [ ! -d "$CODE_SERVER_WORKSPACE_DIR" ]; then
mkdir -p "$ROOT_CODE_SERVER_CONFIG_PATH" mkdir -p "$CODE_SERVER_WORKSPACE_DIR"
ln -s "$CODE_SERVER_CONFIG" "$ROOT_CODE_SERVER_CONFIG_PATH/config.yaml"
fi fi
# Copies the default workspace # Copies the default workspace
if [ ! -e "$CODE_SERVER_WORKSPACE_FILE" ]; then if [ ! -e "$CODE_SERVER_WORKSPACE_FILE" ]; then
bashio::log.warning "CODE_SERVER_CONFIG does not exist.." bashio::log.warning "CODE_SERVER_WORKSPACE_FILE does not exist.."
cp "$DEFAULT_FILES_PATH/SERVER.code-workspace" "$CODE_SERVER_WORKSPACE_FILE" cp "$DEFAULT_FILES_PATH/SERVER.code-workspace" "$CODE_SERVER_WORKSPACE_FILE"
fi fi
@ -76,7 +75,7 @@ setup_config_path() {
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') DEFAULT_CONFIG_PATH=$(bashio::config 'vscode_config_path')
if ! bashio::fs.directory_exists "${DEFAULT_CONFIG_PATH}"; then if ! bashio::fs.directory_exists "${DEFAULT_CONFIG_PATH}"; then
bashio::exit.nok "Configured config path does not exists" bashio::exit.nok "Configured config path does not exist"
fi fi
else else
# otherwise set to local dir # otherwise set to local dir

View file

@ -15,7 +15,6 @@ run() {
bashio::log.warning "CUSTOM_BASH_SCRIPTS_PATH path did not exist, creating $CUSTOM_BASH_SCRIPTS_PATH" bashio::log.warning "CUSTOM_BASH_SCRIPTS_PATH path did not exist, creating $CUSTOM_BASH_SCRIPTS_PATH"
mkdir -p "$CUSTOM_BASH_SCRIPTS_PATH" || mkdir -p "$CUSTOM_BASH_SCRIPTS_PATH" ||
bashio::exit.nok "Could not create persistent storage folder." bashio::exit.nok "Could not create persistent storage folder."
fi fi
if [[ ! -e "$CUSTOM_BASH_SCRIPTS_PATH"/custom-template.sh ]]; then if [[ ! -e "$CUSTOM_BASH_SCRIPTS_PATH"/custom-template.sh ]]; then
@ -31,7 +30,6 @@ run() {
done done
fi fi
} }
run run