From 38cdfd6bb92de514d9ffb3989d63ae05d57eafbc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 22 Aug 2021 09:07:55 +0200 Subject: [PATCH] Fix --- scripts/restore | 2 +- scripts/upgrade | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 7b51070..1c81c01 100755 --- a/scripts/restore +++ b/scripts/restore @@ -70,7 +70,7 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Restoring the data directory..." --time --weight=1 +ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$datadir" --not_mandatory diff --git a/scripts/upgrade b/scripts/upgrade index 09355cd..abd4457 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # CHECK VERSION @@ -45,6 +46,12 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +# If datadir doesn't exist, create it +if [ -z "$datadir" ]; then + datadir=/home/yunohost.app/$app + ynh_app_setting_set --app=$app --key=datadir --value=$datadir +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all