3
0
mirror of https://github.com/grafana/grafana.git synced 2025-02-25 18:55:37 -06:00
grafana/scripts/helpers/exit-if-fail.sh
Oleg Gaidarenko 4b16cd6cc8
Build: Introduce shellcheck ()
* Build: introduce shellcheck

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