From 4ee7f86669763d2cf5504fe3ca254e7ea7007d21 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 1 Mar 2022 02:31:26 +0100 Subject: [PATCH] Fix datadir removal --- scripts/remove | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/remove b/scripts/remove index d1b8714..56b255e 100755 --- a/scripts/remove +++ b/scripts/remove @@ -68,10 +68,12 @@ ynh_secure_remove --file="$final_path" # REMOVE DATA DIR #================================================= -# Remove the data directory -# We doesn't support --purge cause it's not relevant here -ynh_script_progression --message="Removing app data directory..." --time --weight=1 -ynh_secure_remove --file="$datadir" +# Remove the data directory if --purge option is used +if [ "${YNH_APP_PURGE:-0}" -eq 1 ] +then + ynh_script_progression --message="Removing app data directory..." + ynh_secure_remove --file="$datadir" +fi #================================================= # REMOVE NGINX CONFIGURATION