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
fb2722afde
commit
0e99d4af51
3 changed files with 6 additions and 8 deletions
|
@ -16,4 +16,5 @@ readonly CODE_SERVER_WORKSPACE_FILE="$CODE_SERVER_WORKSPACE_DIR/SERVER.code-work
|
|||
|
||||
# Run the code server
|
||||
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"
|
||||
|
|
|
@ -56,15 +56,14 @@ setup_clean_view() {
|
|||
}
|
||||
|
||||
setup_code_workspace() {
|
||||
# Set a link to where code-server expects the config to be
|
||||
if [ ! -d "$ROOT_CODE_SERVER_CONFIG_PATH" ]; then
|
||||
mkdir -p "$ROOT_CODE_SERVER_CONFIG_PATH"
|
||||
ln -s "$CODE_SERVER_CONFIG" "$ROOT_CODE_SERVER_CONFIG_PATH/config.yaml"
|
||||
# Create the workspace dir
|
||||
if [ ! -d "$CODE_SERVER_WORKSPACE_DIR" ]; then
|
||||
mkdir -p "$CODE_SERVER_WORKSPACE_DIR"
|
||||
fi
|
||||
|
||||
# Copies the default workspace
|
||||
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"
|
||||
fi
|
||||
|
||||
|
@ -76,7 +75,7 @@ setup_config_path() {
|
|||
if bashio::config.has_value "vscode_config_path"; then
|
||||
DEFAULT_CONFIG_PATH=$(bashio::config 'vscode_config_path')
|
||||
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
|
||||
else
|
||||
# otherwise set to local dir
|
||||
|
|
|
@ -15,7 +15,6 @@ run() {
|
|||
bashio::log.warning "CUSTOM_BASH_SCRIPTS_PATH path did not exist, creating $CUSTOM_BASH_SCRIPTS_PATH"
|
||||
mkdir -p "$CUSTOM_BASH_SCRIPTS_PATH" ||
|
||||
bashio::exit.nok "Could not create persistent storage folder."
|
||||
|
||||
fi
|
||||
|
||||
if [[ ! -e "$CUSTOM_BASH_SCRIPTS_PATH"/custom-template.sh ]]; then
|
||||
|
@ -31,7 +30,6 @@ run() {
|
|||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
run
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue