From 82fc622ff076928f4d8dd3ed0049bdb5b98832e5 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sun, 23 Jul 2023 23:32:37 -0400 Subject: [PATCH] build: Add support for out-of-tree Last-Updated The post-receive hook isn't building from within the git dir, so it needs to be able to look it up.. hackiest solution was from the env! --- bin/genpage | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/genpage b/bin/genpage index c1143bc..86bee5a 100755 --- a/bin/genpage +++ b/bin/genpage @@ -4,6 +4,7 @@ [ -z "$1" ] && echo "usage: genpage FILE" 1>&2 && exit 1 REPO=$(dirname "$(dirname "$0")") +GITDIR=${GITDIR:-$REPO} title=$(grep '^# ' "$1" | cut -c3- | tr -d '`*_') cat <
-Last Updated: $(git log --pretty="%cs" -n 1 -- "$1") +Last Updated: $(git -C "$GITDIR" log --pretty="%cs" -n 1 -- "$1") -- libgit2 1.1.1