summaryrefslogtreecommitdiff
path: root/tidy-hooks
diff options
context:
space:
mode:
Diffstat (limited to 'tidy-hooks')
-rwxr-xr-xtidy-hooks14
1 files changed, 14 insertions, 0 deletions
diff --git a/tidy-hooks b/tidy-hooks
new file mode 100755
index 0000000..4b195f5
--- /dev/null
+++ b/tidy-hooks
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -e
+
+cd
+
+IFS=''
+find . -not -path '*/.*' -path '*.git' -type d |
+while read -r git_dir; do
+ mkdir -p -- "${git_dir}/hooks"
+ find "${git_dir}/hooks" \( -name '*.sample' -o -type l \) -delete
+ if ! [[ -f "${git_dir}/hooks/post-receive" ]]; then
+ ln -srv git-hooks/post-receive.agefile "${git_dir}/hooks/post-receive"
+ fi
+done