grafana/scripts/helpers/exit-if-fail.sh
Oleg Gaidarenko 4b16cd6cc8
Build: Introduce shellcheck (#18081)
* Build: introduce shellcheck

Fixes #16198
2019-07-23 13:12:33 +03:00

14 lines
239 B
Bash

#!/bin/bash
function exit_if_fail {
# shellcheck disable=SC2124
command=$@
echo "Executing '$command'"
eval "$command"
rc=$?
if [ $rc -ne 0 ]; then
echo "'$command' returned $rc."
exit $rc
fi
}