Now will update itself and reexec itself if it has changes, and is
better at catching syntax errors in manifests
Signed-off-by: Stephen Gran <steve@lobefin.net>
#!/bin/bash
+if ! cmp -s ${PWD}/.git/hooks/pre-commit ${PWD}/tools/git-hooks/pre-commit ; then
+ rm -f ${PWD}/.git/hooks/pre-commit
+ ln -sf ../../tools/git-hooks/pre-commit ${PWD}/.git/hooks/pre-commit
+ exec ${PWD}/.git/hooks/pre-commit
+fi
+
if git rev-parse --verify HEAD &>/dev/null; then
against=HEAD
else
git cat-file blob :0:${file} | sed 's/^import .*/#&/' >${pp}
trap "rm -f ${pp}" RETURN
- local output=$(puppet apply --noop --ignoreimport ${pp} 2>&1)
+ local output=$(puppet apply --noop ${pp} 2>&1)
if [ $? -ne 0 ] || [ -n "${output}" ]; then
echo '** Syntax check failed:' >&2
echo "${output}" >&2