1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lufi_ynh.git synced 2024-09-03 19:36:28 +02:00

Update .fonctions

This commit is contained in:
frju365 2017-04-03 19:26:03 +02:00 committed by GitHub
parent e49460ed41
commit 6835d7c7f5

View file

@ -202,3 +202,15 @@ BACKUP_BEFORE_UPGRADE () { # Backup the current version of the app, restore it i
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
}