From c80bb97efff9a5d2a8625996c5165ff6e3487c28 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Sat, 7 Oct 2017 14:01:04 +0200 Subject: [PATCH] Fix ynh_abort_if_errors and _common.sh --- scripts/backup | 9 +++------ scripts/restore | 14 ++++++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/scripts/backup b/scripts/backup index 3c52289..8eef115 100755 --- a/scripts/backup +++ b/scripts/backup @@ -2,12 +2,6 @@ #================================================= # GENERIC START -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_abort_if_errors - #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -17,9 +11,12 @@ if [ ! -e _common.sh ]; then cp ../settings/scripts/_common.sh ./_common.sh chmod a+rx _common.sh fi + source _common.sh source /usr/share/yunohost/helpers +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #================================================= diff --git a/scripts/restore b/scripts/restore index 0ab61e6..c258791 100755 --- a/scripts/restore +++ b/scripts/restore @@ -2,19 +2,21 @@ #================================================= # GENERIC START -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_abort_if_errors - #================================================= # IMPORT GENERIC HELPERS #================================================= +if [ ! -e _common.sh ]; then + # Get the _common.sh file if it's not in the current directory + cp ../settings/scripts/_common.sh ./_common.sh + chmod a+rx _common.sh +fi + source _common.sh source /usr/share/yunohost/helpers +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #=================================================