From 4a750a207a83f9f7c9bc050cc48df46402da9594 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 24 Jun 2020 02:59:53 +0200 Subject: [PATCH] Fix upgrade --- scripts/upgrade | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index ebdb878..c53d67f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,11 +49,11 @@ elif [ "$is_public" = "No" ]; then is_public=0 fi # Cancel upgrade if the version is too old - if [[ -n $(ynh_app_setting_get $app method) ]]; then - ynh_die "Your current version is too old and cannot be upgraded.\ - If you had a local install, please remove the app and reinstall it.\ - If you had a remote install, please remove the app and install redirect_ynh for this purpose instead." - fi +if [[ -n $(ynh_app_setting_get $app method) ]]; then + ynh_die "Your current version is too old and cannot be upgraded.\ + If you had a local install, please remove the app and reinstall it.\ + If you had a remote install, please remove the app and install redirect_ynh for this purpose instead." +fi # If final_path doesn't exist, create it if [ -z "$final_path" ]; then @@ -61,6 +61,12 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# If app_data_dir doesn't exist, create it +if [ -z "$app_data_dir" ]; then + app_data_dir=/home/yunohost.app/$app + ynh_app_setting_set --app=$app --key=app_data_dir --value=$app_data_dir +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================