diff options
author | Parabola git <git@parabola.nu> | 2014-12-28 03:38:37 +0000 |
---|---|---|
committer | Parabola git <git@parabola.nu> | 2014-12-28 03:38:37 +0000 |
commit | 5cc4ed0cf2cde585c4ac3199be59caedb68bef61 (patch) | |
tree | caead3435e004ad41f3deaca97bfa7150570105b /tidy-hooks | |
parent | ae7d155eda43ea467293dcd0b17b5caad0e5341e (diff) |
Add a post-receive hook to generate agefiles for cgit
Diffstat (limited to 'tidy-hooks')
-rwxr-xr-x | tidy-hooks | 14 |
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 |