changed init-cp run

This commit is contained in:
Richard Sperry 2025-04-15 16:43:25 -07:00
parent 3bf239d424
commit ccff7e0c4d
2 changed files with 17 additions and 10 deletions

View file

@ -27,6 +27,7 @@ readonly DEFAULT_FILES_PATH="/usr/lib/code-server/defaults"
readonly DEFAULT_CONFIG_PATH="/WORKDIR/config/addon_configs/vscode" readonly DEFAULT_CONFIG_PATH="/WORKDIR/config/addon_configs/vscode"
readonly CODE_SERVER_CONFIG_DIR="/root/.config/code-server/" readonly CODE_SERVER_CONFIG_DIR="/root/.config/code-server/"
readonly CODE_SERVER_CONFIG="$CODE_SERVER_CONFIG_DIR/config.yaml" readonly CODE_SERVER_CONFIG="$CODE_SERVER_CONFIG_DIR/config.yaml"
readonly CODE_SERVER_EXTENSIONS_LIST="$CODE_SERVER_CONFIG_DIR/vscode.extensions"
# Ensure config path exists # Ensure config path exists
if bashio::config.has_value "config_path"; then if bashio::config.has_value "config_path"; then
@ -58,6 +59,11 @@ if [ ! -e "$CODE_SERVER_CONFIG" ]; then
cp "$DEFAULT_FILES_PATH/config.yaml" "$CODE_SERVER_CONFIG" cp "$DEFAULT_FILES_PATH/config.yaml" "$CODE_SERVER_CONFIG"
fi fi
if [ ! -e "$CODE_SERVER_EXTENSIONS_LIST" ]; then
bashio::log.error "CODE_SERVER_CONFIG does not exist.."
cp "$DEFAULT_FILES_PATH/vscode.extensions" "$CODE_SERVER_EXTENSIONS_LIST"
fi
if bashio::config.has_value 'log_level'; then if bashio::config.has_value 'log_level'; then
log_level=$(bashio::config 'log_level') log_level=$(bashio::config 'log_level')
if [ "$log_level" = "warning" ] ; then if [ "$log_level" = "warning" ] ; then
@ -73,7 +79,7 @@ if bashio::config.has_value 'log_level'; then
fi fi
# Ensure extensions path # Ensure extensions path
ext_path="$config_path/extensions" ext_path="$CODE_SERVER_CONFIG_DIR/extensions"
if [ ! -d "$ext_path" ]; then if [ ! -d "$ext_path" ]; then
mkdir -p "$ext_path" || mkdir -p "$ext_path" ||
bashio::exit.nok "Could not create persistent extensions folder." bashio::exit.nok "Could not create persistent extensions folder."
@ -87,7 +93,7 @@ if [ ! -d "$ext_path" ]; then
else else
bashio::log.info "Has $extention installed" bashio::log.info "Has $extention installed"
fi fi
done <"$DEFAULT_FILES_PATH/vscode.extensions" done <"$CODE_SERVER_EXTENSIONS_LIST"
fi fi
sed -i "/extensions-dir=/c extensions-dir=\"$ext_path\"" "$CODE_SERVER_CONFIG" sed -i "/extensions-dir=/c extensions-dir=\"$ext_path\"" "$CODE_SERVER_CONFIG"

View file

@ -1,8 +1,9 @@
emilast.LogFileHighlighter#3.4.0 emilast.LogFileHighlighter
esbenp.prettier-vscode#11.0.0 esbenp.prettier-vscode
keesschollaart.vscode-home-assistant#1.43.0 ESPHome.esphome-vscode
lukas-tr.materialdesignicons-intellisense#4.1.0 keesschollaart.vscode-home-assistant
netcorext.uuid-generator#0.0.5 lukas-tr.materialdesignicons-intellisense
oderwat.indent-rainbow#8.3.1 netcorext.uuid-generator
redhat.vscode-yaml#1.11.10112022 oderwat.indent-rainbow
usernamehw.errorlens#3.6.0 redhat.vscode-yaml
usernamehw.errorlens