From dbcf117afbc374eacf1446e66458d586482f0ad2 Mon Sep 17 00:00:00 2001 From: rodinux Date: Wed, 13 Sep 2023 20:09:24 +0200 Subject: [PATCH] add conditions for pass tests if upgrade from none initialyzed app --- scripts/upgrade | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5fec1a8..5182d42 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,7 +33,10 @@ fi # BACKUP SQLITE DATABASE #================================================= ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5 + +if [ -f "$install_dir/data/association.sqlite" ];then cp -a $install_dir/data/association.sqlite /tmp/ +fi #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -86,7 +89,9 @@ ynh_add_config --template="config.local.php" --destination="$install_dir/config. ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" # Restore the sqlite DB -mv /tmp/association.sqlite $install_dir/data +if [ -f "/tmp/association.sqlite" ];then +mv /tmp/association.sqlite $install_dir/data +fi # Permissions on files and directories chmod -R o-rwx "$install_dir"