1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/roundcube_ynh.git synced 2024-09-03 20:16:28 +02:00

[fix] add ynh_abort_if_errors on generic function

This commit is contained in:
magikcypress 2017-06-18 00:02:47 +02:00
parent ee33d1aa61
commit 2c27e1d7b7
No known key found for this signature in database
GPG key ID: 3B3C7CD61957AC9A

View file

@ -341,4 +341,15 @@ ynh_backup_before_upgrade () { # Backup the current version of the app, restore
else # Si le backup a échoué
ynh_die "Backup failed, the upgrade process was aborted."
fi
}
# Exit if an error occurs during the execution of the script.
#
# Stop immediatly the execution if an error occured or if a empty variable is used.
# The execution of the script is derivate to ynh_exit_properly function before exit.
#
# Usage: ynh_abort_if_errors
ynh_abort_if_errors () {
set -eu # Exit if a command fail, and if a variable is used unset.
trap ynh_exit_properly EXIT # Capturing exit signals on shell script
}