mirror of
https://github.com/hassio-addons/addon-vscode.git
synced 2025-05-03 18:51:23 +00:00
changed init-cp run
This commit is contained in:
parent
3bf239d424
commit
ccff7e0c4d
2 changed files with 17 additions and 10 deletions
|
@ -27,6 +27,7 @@ readonly DEFAULT_FILES_PATH="/usr/lib/code-server/defaults"
|
|||
readonly DEFAULT_CONFIG_PATH="/WORKDIR/config/addon_configs/vscode"
|
||||
readonly CODE_SERVER_CONFIG_DIR="/root/.config/code-server/"
|
||||
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
|
||||
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"
|
||||
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
|
||||
log_level=$(bashio::config 'log_level')
|
||||
if [ "$log_level" = "warning" ] ; then
|
||||
|
@ -73,7 +79,7 @@ if bashio::config.has_value 'log_level'; then
|
|||
fi
|
||||
|
||||
# Ensure extensions path
|
||||
ext_path="$config_path/extensions"
|
||||
ext_path="$CODE_SERVER_CONFIG_DIR/extensions"
|
||||
if [ ! -d "$ext_path" ]; then
|
||||
mkdir -p "$ext_path" ||
|
||||
bashio::exit.nok "Could not create persistent extensions folder."
|
||||
|
@ -87,7 +93,7 @@ if [ ! -d "$ext_path" ]; then
|
|||
else
|
||||
bashio::log.info "Has $extention installed"
|
||||
fi
|
||||
done <"$DEFAULT_FILES_PATH/vscode.extensions"
|
||||
done <"$CODE_SERVER_EXTENSIONS_LIST"
|
||||
fi
|
||||
sed -i "/extensions-dir=/c extensions-dir=\"$ext_path\"" "$CODE_SERVER_CONFIG"
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
emilast.LogFileHighlighter#3.4.0
|
||||
esbenp.prettier-vscode#11.0.0
|
||||
keesschollaart.vscode-home-assistant#1.43.0
|
||||
lukas-tr.materialdesignicons-intellisense#4.1.0
|
||||
netcorext.uuid-generator#0.0.5
|
||||
oderwat.indent-rainbow#8.3.1
|
||||
redhat.vscode-yaml#1.11.10112022
|
||||
usernamehw.errorlens#3.6.0
|
||||
emilast.LogFileHighlighter
|
||||
esbenp.prettier-vscode
|
||||
ESPHome.esphome-vscode
|
||||
keesschollaart.vscode-home-assistant
|
||||
lukas-tr.materialdesignicons-intellisense
|
||||
netcorext.uuid-generator
|
||||
oderwat.indent-rainbow
|
||||
redhat.vscode-yaml
|
||||
usernamehw.errorlens
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue