cd "$(git rev-parse --show-toplevel)"
if git diff --staged --quiet --exit-code HEAD binary.py
then :
else
	echo "binary.py has been changed"
	if [ $(git diff --staged HEAD binary.py | grep -c '^.BUILD_VERSION') -ne 2 ]
	then
		echo "Please update BUILD_VERSION"
		exit 1
	fi
fi

if [ "$(cat .binary_version)" != "$(python binary.py --version)" ]
then
	echo "BUILD_VERSION of binary.py does not match with .build_version"
	exit 1
fi
