From d7637776418a43c077dbbb680747a9886faa9253 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 20 Sep 2021 18:46:11 +0200 Subject: [PATCH] Fix --- manifest.json | 6 ++---- scripts/restore | 2 -- scripts/upgrade | 32 ++++++++++++++++---------------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/manifest.json b/manifest.json index c474638..b8d7e21 100644 --- a/manifest.json +++ b/manifest.json @@ -31,8 +31,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", @@ -42,8 +41,7 @@ }, { "name": "admin", - "type": "user", - "example": "johndoe" + "type": "user" }, { "name": "is_public", diff --git a/scripts/restore b/scripts/restore index 9eaae0a..00b312d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -37,8 +37,6 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " diff --git a/scripts/upgrade b/scripts/upgrade index 6310742..c06bdad 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,6 +28,22 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) 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)..." --weight=5 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + ynh_clean_check_starting + + # restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -57,22 +73,6 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=5 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - ynh_clean_check_starting - - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #=================================================