This commit is contained in:
Richard Sperry 2025-04-16 23:51:38 -07:00
parent f9472e950f
commit 0da52ef02c

View file

@ -43,9 +43,16 @@ run() {
setup_clean_view() { setup_clean_view() {
# Links some common directories to the user's home folder for convenience # Links some common directories to the user's home folder for convenience
for dir in "${DIRECTORIES[@]}"; do for dir in "${DIRECTORIES[@]}"; do
if [[ ! -d "${CODE_SERVER_WORKSPACE_DIR}"/"${dir}" ]]; then current="${CODE_SERVER_WORKSPACE_DIR}"/"${dir}"
ln -sn "/${dir}" "${CODE_SERVER_WORKSPACE_DIR}"/"${dir}" || if [ -L "${current}" ] && [ -e "${current}" ]; then
bashio::log.warning "Failed linking common directory: ${dir}" bashio::log.info "${dir} has good link"
elif [ ! -e "${current}" ]; then
rm -f "${current}"
ln -sn "/${dir}" "$current" ||
bashio::log.warning "Failed linking common directory: ${dir}"
else
ln -sn "/${dir}" "$current" ||
bashio::log.warning "Failed linking common directory: ${dir}"
fi fi
done done