diff --git a/scripts/restore b/scripts/restore index 57b7362..b3753e3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -35,7 +35,8 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path || ynh_die "There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS diff --git a/scripts/upgrade b/scripts/upgrade index 7ecc61e..f87c34d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,17 +85,9 @@ ynh_script_progression --message="Upgrading source files..." if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." - # Move old app dir - mv ${final_path} ${final_path}.old # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source "$final_path" - - # restore data - cp -a ${final_path}.old/data ${final_path} - - # delete temp directory - ynh_secure_remove --file=${final_path}.old + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/data " fi chmod 750 "$final_path"