diff --git a/config/functions b/config/functions index 58364d45ce..aa40401a68 100644 --- a/config/functions +++ b/config/functions @@ -1,4 +1,12 @@ ### FUNCTION HELPERS ### +# die (message, code) abort with optional message and code +die() { + if [ -n "$1" ]; then + echo -e "$1" >&2 + fi + exit "${2:-1}" +} + # return 0 if $2 in space-separated list $1, otherwise return 1 listcontains() { if [ -n "$1" -a -n "$2" ]; then