From 40a125d157cbac187384a31a93414e32a832ef58 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sun, 5 Dec 2021 18:43:44 +0100 Subject: [PATCH] Add blog git setup. --- bullseye/other_files/blog_hook_post-receive | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bullseye/other_files/blog_hook_post-receive diff --git a/bullseye/other_files/blog_hook_post-receive b/bullseye/other_files/blog_hook_post-receive new file mode 100755 index 0000000..b671248 --- /dev/null +++ b/bullseye/other_files/blog_hook_post-receive @@ -0,0 +1,17 @@ +#!/bin/sh +blog_dir=~/blog +export GIT_DIR=$(pwd) +export GIT_WORK_TREE="$blog_dir" +git checkout -f +cd "$GIT_WORK_TREE" +redo +git add metadata/author metadata/url metadata/title metadata/*.tmpl metadata/automatic_metadata captchas/linkable/* +count=$(ls -1 metadata/*.automatic_metadata 2>/dev/null | wc -l) +if [ "$count" != 0 ]; then + git add metadata/*.automatic_metadata +fi +status=$(git status -s) +n_updates=$(printf "$status" | grep -vE '^\?\?' | wc -l) +if [ "$n_updates" -gt 0 ]; then + git commit -a -m 'Update metadata' +fi -- 2.30.2