From 576ec05a9e074d89831a559d6d79452a70b6f999 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 21 Oct 2017 13:52:08 -0400 Subject: [PATCH] fix: handle case where the app directory is a symlink Closes #2943 --- plugins/apps/post-delete | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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