From 0c33e1922913c4c3d329acf8721d97ccdfe7eae8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 19 Aug 2021 20:24:24 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 855b543..4a8e4d5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,16 +38,19 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1 -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors +# Backup the current version of the app unless --no_safety_backup option is used +if [ "$NO_BACKUP_UPGRADE" -eq 0 ] +then + ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1 + ynh_backup_before_upgrade + ynh_clean_setup () { + # Restore it if the upgrade fails + ynh_restore_upgradebackup + } + # Exit if an error occurs during the execution of the script + ynh_abort_if_errors +fi #================================================= # STANDARD UPGRADE STEPS