From 007a826320ef9fc76ff207f21aa4793829da0cf8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Nov 2021 21:07:18 +0100 Subject: [PATCH] Update upgrade --- scripts/upgrade | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 81e43d5..64675e8 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) group_name=$(ynh_app_setting_get --app=$app --key=group_name) port=$(ynh_app_setting_get --app=$app --key=port) turn_port=$(ynh_app_setting_get --app=$app --key=turn_port) -architecture=$(ynh_app_setting_get --app=$app --key=architecture) +architecture=$YNH_ARCH if ynh_compare_current_package_version --comparison le --version 0.3.5~ynh3 then @@ -62,12 +62,6 @@ then ynh_exec_warn_less yunohost firewall disallow TCP $port fi -# If architecture doesn't exist, create it -if [ -z "$architecture" ]; then - architecture=$YNH_ARCH - architecture=$(ynh_app_setting_get --app=$app --key=architecture) -fi - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/opt/yunohost/$app @@ -106,6 +100,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=2 + # Remove the app directory securely + ynh_secure_remove --file=$final_path ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" #--keep="$final_path/data/config.json" fi