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
188ee87e52
commit
5806b78547
1 changed files with 16 additions and 15 deletions
|
@ -82,25 +82,11 @@ if bashio::config.has_value 'log_level'; then
|
|||
fi
|
||||
|
||||
# Ensure User settings path
|
||||
user_path="$CODE_SERVER_CONFIG/user"
|
||||
user_path="$DEFAULT_CONFIG_PATH/user"
|
||||
if [ ! -d "$user_path" ]; then
|
||||
mkdir -p "$user_path" ||
|
||||
bashio::exit.nok "Could not create persistent User folder."
|
||||
fi
|
||||
sed -i "/user-data-dir=/c user-data-dir=\"$user_path\"" "$CODE_SERVER_CONFIG"
|
||||
|
||||
# Ensure extensions path
|
||||
if [ ! -e "$CODE_SERVER_EXTENSIONS_LIST" ]; then
|
||||
bashio::log.error "CODE_SERVER_EXTENSIONS_LIST does not exist.."
|
||||
cp "$DEFAULT_FILES_PATH/vscode.extensions" "$CODE_SERVER_EXTENSIONS_LIST"
|
||||
fi
|
||||
|
||||
if [ ! -d "$CODE_SERVER_EXTENSIONS_INSTALL_PATH" ]; then
|
||||
bashio::log.error "CODE_SERVER_EXTENSIONS_INSTALL_PATH does not exist.."
|
||||
mkdir -p "$CODE_SERVER_EXTENSIONS_INSTALL_PATH" ||
|
||||
bashio::exit.nok "Could not create persistent extensions folder."
|
||||
|
||||
fi
|
||||
|
||||
# Sets up default user settings on first start.
|
||||
if ! bashio::fs.file_exists "$user_path"/settings.json; then
|
||||
|
@ -114,10 +100,25 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
sed -i "/user-data-dir=/c user-data-dir=\"$user_path\"" "$CODE_SERVER_CONFIG"
|
||||
|
||||
if ! bashio::fs.file_exists "$user_path"/workspaces.json; then
|
||||
cp "$DEFAULT_FILES_PATH/workspaces.json" "$user_path/workspaces.json"
|
||||
fi
|
||||
|
||||
# Ensure extensions path
|
||||
if [ ! -e "$CODE_SERVER_EXTENSIONS_LIST" ]; then
|
||||
bashio::log.error "CODE_SERVER_EXTENSIONS_LIST does not exist.."
|
||||
cp "$DEFAULT_FILES_PATH/vscode.extensions" "$CODE_SERVER_EXTENSIONS_LIST"
|
||||
fi
|
||||
|
||||
if [ ! -d "$CODE_SERVER_EXTENSIONS_INSTALL_PATH" ]; then
|
||||
bashio::log.error "CODE_SERVER_EXTENSIONS_INSTALL_PATH does not exist.."
|
||||
mkdir -p "$CODE_SERVER_EXTENSIONS_INSTALL_PATH" ||
|
||||
bashio::exit.nok "Could not create persistent extensions folder."
|
||||
|
||||
fi
|
||||
|
||||
# Install code-server extensions via code-server so terminate is aware of them.
|
||||
bashio::log.info "Installing extentions listed in addon_configs/vscode/vscode.extensions"
|
||||
while read -r extention; do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue