diff --git a/vscode/rootfs/etc/s6-overlay/s6-rc.d/init-code-server/run b/vscode/rootfs/etc/s6-overlay/s6-rc.d/init-code-server/run index 3917344..e283545 100644 --- a/vscode/rootfs/etc/s6-overlay/s6-rc.d/init-code-server/run +++ b/vscode/rootfs/etc/s6-overlay/s6-rc.d/init-code-server/run @@ -43,19 +43,23 @@ run() { setup_clean_view() { # Links some common directories to the user's home folder for convenience for dir in "${DIRECTORIES[@]}"; do - current="${CODE_SERVER_WORKSPACE_DIR}"/"${dir}" + if [ -e "${dir}" ]; then + current="${CODE_SERVER_WORKSPACE_DIR}"/"${dir}" - if [ ! -e "${current}" ]; then - bashio::log.warning "Creating link for: ${dir}..." - ln -sn "/${dir}" "$current" || - bashio::log.warning "Failed linking common directory: ${dir}" - elif [ ! -L "${current}" ]; then - bashio::log.warning "Failed link: ${dir}. Removing and recreating..." - rm -f "${current}" - ln -sn "/${dir}" "$current" || - bashio::log.warning "Failed linking common directory: ${dir}" + if [ ! -e "${current}" ]; then + bashio::log.warning "Creating link for: ${dir}..." + ln -sn "/${dir}" "$current" || + bashio::log.warning "Failed linking common directory: ${dir}" + elif [ ! -L "${current}" ]; then + bashio::log.warning "Failed link: ${dir}. Removing and recreating..." + rm -f "${current}" + ln -sn "/${dir}" "$current" || + bashio::log.warning "Failed linking common directory: ${dir}" + else + bashio::log.info "${dir} has good link." + fi else - bashio::log.info "${dir} has good link." + bashio::log.warning "${dir} does not exist, cannot link..." fi done