Commit 8f8f8726 authored by Ben Boeckel's avatar Ben Boeckel

hooks: check that SetupForDevelopment is up-to-date

parent b03ed0cf
......@@ -2,4 +2,5 @@
# during git commit after local hooks have been installed.
[hooks "chain"]
pre-commit = utilities/git/pre-commit
pre-push = utilities/git/pre-push
#!/usr/bin/env bash
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
die() {
echo 'pre-commit hook failure' 1>&2
echo '-----------------------' 1>&2
echo '' 1>&2
echo "$@" 1>&2
exit 1
}
#-----------------------------------------------------------------------------
# Check that development setup is up-to-date.
lastSetupForDevelopment=$(git config --get hooks.SetupForDevelopment || echo 0)
eval $(grep '^SetupForDevelopment_VERSION=' "${BASH_SOURCE%/*}/../SetupForDevelopment.sh")
test -n "$SetupForDevelopment_VERSION" || SetupForDevelopment_VERSION=0
if test $lastSetupForDevelopment -lt $SetupForDevelopment_VERSION; then
die 'Developer setup in this work tree is out of date. Please re-run
utilities/SetupForDevelopment.sh
'
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment