commit 82fc622ff076928f4d8dd3ed0049bdb5b98832e5 (patch)
parent 2ae4c243186310fd7137eb1d8f7abb8a55e6d214
Author: Alex Karle <alex@alexkarle.com>
Date: Sun, 23 Jul 2023 23:32:37 -0400
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!
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git 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 <<EOM
@@ -36,7 +37,7 @@ if echo "$1" | grep -q -v "blog/"; then
cat <<EOM
<footer>
<br>
-<em>Last Updated: $(git log --pretty="%cs" -n 1 -- "$1")</em>
+<em>Last Updated: $(git -C "$GITDIR" log --pretty="%cs" -n 1 -- "$1")</em>
</footer>
</body>
</html>