From ebaea2dbda8e401db90cffe7d4a27f780b5ec9ac Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 10 Oct 2017 16:30:33 +0530 Subject: [PATCH] scripts: use `ynh_abort_if_errors` helper --- scripts/backup | 8 +++++++- scripts/install | 4 +++- scripts/restore | 8 +++++++- scripts/upgrade | 4 +++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/backup b/scripts/backup index fa1df5e..9d9d10c 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,5 +1,4 @@ #!/bin/bash -set -eu # exit on error ; treat unset variables as error #================================================= # IMPORT GENERIC HELPERS @@ -7,6 +6,13 @@ set -eu # exit on error ; treat unset variables as error source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #================================================= diff --git a/scripts/install b/scripts/install index 2cae0b0..d69217f 100644 --- a/scripts/install +++ b/scripts/install @@ -1,5 +1,4 @@ #!/bin/bash -set -eu # exit on error ; treat unset variables as error # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN @@ -10,6 +9,9 @@ path="" # Source app helpers source /usr/share/yunohost/helpers +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + # Set up common variables root_path="$(pwd)/.." final_path=/var/www/mattermost diff --git a/scripts/restore b/scripts/restore index d187861..37c630a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,5 +1,4 @@ #!/bin/bash -set -eu # exit on error ; treat unset variables as error #================================================= # IMPORT GENERIC HELPERS @@ -7,6 +6,13 @@ set -eu # exit on error ; treat unset variables as error source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a7e0f2e..1887036 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,9 +1,11 @@ #!/bin/bash -set -eu # exit on error ; treat unset variables as error # Source app helpers source /usr/share/yunohost/helpers +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + # Retrieve arguments domain=$(ynh_app_setting_get mattermost domain) is_public=$(ynh_app_setting_get mattermost is_public)