Start with errors shell lib

This commit is contained in:
Darko Poljak 2019-10-07 11:22:54 +02:00
parent bcdfc0eaa3
commit c88e6acc77

16
cdist/conf/lib/errors.sh Normal file
View file

@ -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
}