#!/bin/sh
#
# PartKeepr pre-commit hook.
# Checks if everything looks well before comitting

RESULT=`phing pre-commit`

RETVAL=$?

if [ $RETVAL -ne 0 ]; then
	echo "phing pre-commit finished with errors. Please check the output of 'phing pre-commit' manually."
	exit 254
fi;

NUM=`echo $RESULT | grep -i "warning" | wc -l`

if [ $NUM -ne 0 ]; then
	echo "phing pre-commit finished with warnings. Please check the output manually."
	exit 254
fi;
