[enh] Add ynh_die helper to print error message and exit

This commit is contained in:
Jérôme Lebleu 2016-05-06 20:30:37 +02:00
parent be9d744f3c
commit f065ac6baa

6
data/helpers.d/print Normal file
View file

@ -0,0 +1,6 @@
# Print a message to stderr and exit
# usage: ynh_die MSG [RETCODE]
ynh_die() {
echo "$1" 1>&2
exit "${2:-1}"
}