From f065ac6baa158bbe1c30796a0dc79bf76a60934c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Fri, 6 May 2016 20:30:37 +0200 Subject: [PATCH] [enh] Add ynh_die helper to print error message and exit --- data/helpers.d/print | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 data/helpers.d/print diff --git a/data/helpers.d/print b/data/helpers.d/print new file mode 100644 index 00000000..4cc8417d --- /dev/null +++ b/data/helpers.d/print @@ -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}" +}