@@ -183,5 +183,9 @@ dns:
sudo service pdns enable
sudo service pdns start
+.PHONY: githook
+githook:
+ cp git-hooks/pre-commit .git/hooks
+
.PHONY: all
-all: prereq-debian install fail2ban nginx mail
+all: prereq-debian install fail2ban nginx mail dns githook
@@ -0,0 +1,14 @@
+#!/bin/sh
+to_tidy=$(git diff --cached --name-only | egrep ".p[m|l]$")
+# Redirect output to stderr.
+exec 1>&2
+if [ $to_tidy ]
+then
+ echo "Auto-tidying perl changes..."
+ perltidy -b $to_tidy
+ git add $to_tidy
+ echo "Done."
+fi