Merge pull request #2951 from dokku/josegonzalez-patch-1

fix: handle case where the app directory is a symlink
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2017-10-22 14:06:15 -04:00
commit 0581b38adf
1 file changed
+6 -1
+6 -1
View File
@@ -6,7 +6,12 @@ app_post_delete() {
declare desc="apps post-delete plugin trigger" declare desc="apps post-delete plugin trigger"
local trigger="app_post_delete" local trigger="app_post_delete"
local APP="$1"; local IMAGE_REPO=$(get_app_image_repo "$APP") 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 # remove all application containers & images
# shellcheck disable=SC2046 # shellcheck disable=SC2046