diff --git a/plugins/apps/post-delete b/plugins/apps/post-delete index 9263b31d8..be58c6885 100755 --- a/plugins/apps/post-delete +++ b/plugins/apps/post-delete @@ -6,7 +6,12 @@ app_post_delete() { declare desc="apps post-delete plugin trigger" local trigger="app_post_delete" local APP="$1"; local IMAGE_REPO=$(get_app_image_repo "$APP") - [[ -n $APP ]] && rm -rf "${DOKKU_ROOT:?}/$APP" > /dev/null + if [[ -n $APP ]]; then + # remove contents for apps that are symlinks to other folders + rm -rf "${DOKKU_ROOT:?}/$APP/" > /dev/null + # then remove the folder and/or the symlink + rm -rf "${DOKKU_ROOT:?}/$APP" > /dev/null + fi # remove all application containers & images # shellcheck disable=SC2046