Do error checking properly
This commit is contained in:
24
pre-receive
24
pre-receive
@@ -3,16 +3,32 @@ warned=0
|
||||
final_ret=0
|
||||
|
||||
# Check for ruby binary
|
||||
which ruby >/dev/null 2>&1 || echo "Ruby not found" 1>&2 && exit 1
|
||||
which ruby >/dev/null 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Ruby not found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for Puppet binary
|
||||
which puppet >/dev/null 2>&1 || echo "Puppet not found" 1>&2 && exit 1
|
||||
which puppet >/dev/null 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Puppet not found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for puppet-lint
|
||||
which puppet-lint >/dev/null 2>&1 || echo "puppet-lint not found" 1>&2 && exit 1
|
||||
which puppet-lint >/dev/null 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "puppet-lint not found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for erb
|
||||
which erb >/dev/null 2>&1 || echo "erb not found" 1>&2 && exit 1
|
||||
which erb >/dev/null 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "erb not found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tmpdir=`mktemp -d`
|
||||
tmpfile="$tmpdir/candidate"
|
||||
|
||||
Reference in New Issue
Block a user