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