From 5cc4ed0cf2cde585c4ac3199be59caedb68bef61 Mon Sep 17 00:00:00 2001 From: Parabola git Date: Sun, 28 Dec 2014 03:38:37 +0000 Subject: Add a post-receive hook to generate agefiles for cgit --- tidy-hooks | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 tidy-hooks (limited to 'tidy-hooks') 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 -- cgit v1.2.3-54-g00ecf