From a9ea626518e81608df9d98a77b6f386c24fe0a68 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 14 Jul 2021 17:40:25 +0100 Subject: [PATCH] Add datapath app setting if needed Fixes https://github.com/YunoHost-Apps/piwigo_ynh/issues/75 Backup crashed because it expects an app setting that has been created in the install script but not the upgrade one. --- scripts/upgrade | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index db37df7..4ed1b97 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,6 +34,15 @@ ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# FIX MISSING APP SETTING THAT BREAKS BACKUP +#================================================= +# If datapath doesn't exist, create it +if [ -z "$datapath" ]; then + datapath=/home/yunohost.app/$app + ynh_app_setting_set --app=$app --key=datapath --value=$datapath +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================