mirror of
https://github.com/hassio-addons/addon-vscode.git
synced 2025-05-03 18:51:23 +00:00
the file doesnt have 99 lines.... ffs
This commit is contained in:
parent
d9cce023a6
commit
efbc6da930
7 changed files with 15 additions and 66 deletions
12
.shellcheckrc
Normal file
12
.shellcheckrc
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Look for 'source'd files relative to the checked script,
|
||||
# and also look for absolute paths in /mnt/chroot
|
||||
source-path=source
|
||||
|
||||
# Allow opening any 'source'd file, even if not specified as input
|
||||
external-sources=true
|
||||
|
||||
# Turn on warnings for unquoted variables with safe values
|
||||
enable=quote-safe-variables
|
||||
|
||||
# Turn on warnings for unassigned uppercase variables
|
||||
enable=check-unassigned-uppercase
|
|
@ -32,7 +32,7 @@ RUN apt-get update \
|
|||
locales \
|
||||
mariadb-client \
|
||||
mosquitto-clients \
|
||||
net-tools=2.10-0.1 \
|
||||
net-tools \
|
||||
openssh-client \
|
||||
openssl \
|
||||
python3-dev \
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
#!/command/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Studio Code Server
|
||||
# Sets up code-server.
|
||||
# ==============================================================================
|
||||
declare config_path
|
||||
|
||||
# List of previous config hashes, to allow upgrade "default" configs.
|
||||
readonly -a PREVIOUS_DEFAULT_CONFIG_HASHES=(
|
||||
86776df88391c3d94f79f62b430f9ff8538960628d5e04fb660165a5a46640d2e74f89cd68b3e6985dc59101ae2dda00a1e25aa48381acfd4736858c5f23878b
|
||||
2be4c50575c05711d30121c3a1320698d3dbb034523c481be3aad3b638af3e0a46113d8c3f8cfc1b0f01e4cc10f32da3a30feca161c31b5b27177aeb7231bf70
|
||||
d4745002643a0168f65bc5b465a9baff59af0fb4783b50553e1a4e8b3f1a569fc4905df19b7743f7f313a5809a5128d997fc4b5e0a0e5db0a01f47b3b7bec39d
|
||||
6ed36f832778926fa614fc12eec97b8f813bbb1a04f709769c9e5f54bc8e3cfc05a110155921a3b2ae47fc8389d24fa2bd385e4ce5a6c94850813791a6ac1c82
|
||||
944d9ba57968666353df7e9dc78ec5d94b9b052e1abf863b51bc1f372d9f35cb2d93259f153e9ab3b3dd1b520bfcd7bddb54803bcfd9eb65975ae8fb5553663c
|
||||
4ef960e3d6e795adda51d5cbeb18d309fee87ba5cd177292a21b5a70a71a4726ae7053c3793cddc6d63d3b4dacc180ad3ea12d005fc8d63a1bc4cb29f9a17f18
|
||||
c5b8acf06ef6d9a2435e9ddb92cb9fce7cfbfe4a2206b0e0c3c4ed514cc926f8d3c662e694a995d102b5ba939056f93201c220558e06e1cd0872bfb1995ba148
|
||||
08d86c84a0d80720b22712e878963e90cbb34b659330dad8a823f3c5c7f0ae043d197a5e3020dd7ab4fda3625e17f794675ec074984951e7107db2488898a8d0
|
||||
5243d7664d30b5aa0c45fbe1089cccdf85c5ade17cddd97e21b3a29ccb37b20d20bdfecc141ad6e1a7aa5ea8ee61695a79a43140a2d53f9f91687bc61f7e496c
|
||||
e5106aaaff5f67a693fd49deb7dd52f1cc0f7ba542b33c99c0099bf58f1a33c789d1c5e3803dea2942540c07c734f3ca317c3cc91673aff388cb79ee7112db0b
|
||||
b28a299111ac74cc9498f76ce2cb437b2cf5e8e7bb9388d9929347e2948bd56591bd499d5de04638553f6e12fa77c53320a046e96cffce9fa4f8c924d5c91581
|
||||
dbe905f0935b2fea8bb5ba379bff78db9d056ea6d0965c68aa9b07938a52cbbf117186452b2b6c766aa4cf93cc3494ad91b763e8500e515e41d8cde31a3821ae
|
||||
2212babaa9dc46d38ba239052c9c05151abe517cc8b493d0d351a96bf70c1efa4f7479f6ed0b75811429ba649906eb5657d73b0732b460e718a5c66603dcdbda
|
||||
)
|
||||
|
||||
if bashio::config.has_value 'config_path'; then
|
||||
config_path=$(bashio::config 'config_path')
|
||||
if ! bashio::fs.directory_exists "${config_path}"; then
|
||||
bashio::exit.nok "Configured config path does not exists"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Ensure persistent data folder exists.
|
||||
if ! bashio::fs.directory_exists '/data/vscode'; then
|
||||
mkdir -p /data/vscode/extensions \
|
||||
|| bashio::exit.nok "Could not create persistent storage folder."
|
||||
fi
|
||||
|
||||
# Clean up copies of extensions we deliver from the persistent storage
|
||||
while read -r ext; do
|
||||
extension="${ext%%#*}"
|
||||
# shellcheck disable=SC2086
|
||||
rm -f -r /data/vscode/extensions/${extension,,}*
|
||||
done < /root/vscode.extensions
|
||||
|
||||
# Ensure user extensions folder exists
|
||||
mkdir -p /data/vscode/extensions
|
||||
|
||||
# Sets up default user settings on first start.
|
||||
if ! bashio::fs.file_exists '/data/vscode/User/settings.json'; then
|
||||
mkdir -p /data/vscode/User \
|
||||
|| bashio::exit.nok "Could not create persistent storage folder."
|
||||
|
||||
cp /root/.code-server/settings.json /data/vscode/User/settings.json
|
||||
fi
|
||||
|
||||
# Upgrade settings.json is still default from previous version.
|
||||
current=$(sha512sum /data/vscode/User/settings.json|cut -d " " -f 1)
|
||||
if [[ " ${PREVIOUS_DEFAULT_CONFIG_HASHES[*]} " == *" ${current} "* ]]; then
|
||||
cp /root/.code-server/settings.json /data/vscode/User/settings.json
|
||||
fi
|
|
@ -1 +0,0 @@
|
|||
oneshot
|
|
@ -1 +0,0 @@
|
|||
/etc/s6-overlay/s6-rc.d/init-code-server/run
|
|
@ -38,7 +38,7 @@ else
|
|||
config_path="$DEFAULT_CONFIG_PATH"
|
||||
if ! bashio::fs.directory_exists "$config_path"; then
|
||||
bashio::log.info "Config path did not exist, createing $config_path"
|
||||
mkdir -p $config_path ||
|
||||
mkdir -p "$config_path" ||
|
||||
bashio::exit.nok "Could not create persistent storage folder."
|
||||
fi
|
||||
fi
|
||||
|
@ -46,7 +46,7 @@ fi
|
|||
bashio::log.info "using code-server config path: $config_path"
|
||||
|
||||
# Ensure code-server config
|
||||
if ! bashio::fs.file_exists $CODE_SERVER_CONFIG; then
|
||||
if ! bashio::fs.file_exists "$CODE_SERVER_CONFIG"; then
|
||||
cp "$DEFAULT_FILES_PATH/config.yaml" "$CODE_SERVER_CONFIG"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue