From 019d207c2f22616001dea719a0e4b0d18c647221 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 1 Nov 2021 21:09:29 +0100 Subject: [PATCH] helpers: Don't say the 'app was restored' when restore failed after failed upgrade --- data/helpers.d/backup | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data/helpers.d/backup b/data/helpers.d/backup index 27ffa015c..98a61c16a 100644 --- a/data/helpers.d/backup +++ b/data/helpers.d/backup @@ -479,7 +479,12 @@ ynh_restore_upgradebackup() { yunohost app remove $app # Restore the backup yunohost backup restore $app_bck-pre-upgrade$backup_number --apps $app --force --debug - ynh_die --message="The app was restored to the way it was before the failed upgrade." + if [[ -d /etc/yunohost/apps/$app ]] + then + ynh_die --message="The app was restored to the way it was before the failed upgrade." + elif + ynh_die --message="Uhoh ... Yunohost failed to restore the app to the way it was before the failed upgrade :|" + fi fi else ynh_print_warn --message="\$NO_BACKUP_UPGRADE is set, that means there's no backup to restore. You have to fix this upgrade by yourself !"