From c88e6acc77c78d90c42f97dccc5dacb388d9bc99 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 7 Oct 2019 11:22:54 +0200 Subject: [PATCH] Start with errors shell lib --- cdist/conf/lib/errors.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 cdist/conf/lib/errors.sh diff --git a/cdist/conf/lib/errors.sh b/cdist/conf/lib/errors.sh new file mode 100644 index 00000000..0aa0437a --- /dev/null +++ b/cdist/conf/lib/errors.sh @@ -0,0 +1,16 @@ +__cdist_unsupported_os() { + if [ $# -gt 0 ] + then + os=$1 + shift + else + os=$(cat "$__explorer/os") + fi + printf "Your operating system \"%s\" is currently not supported.\nPlease contribute an implementation for it if you can.\n" "${os}" >&2 + exit 1 +} + +__cdist_error() { + printf "$@" >&2 + exit 1 +}