From: Christian Heller Date: Sun, 5 Dec 2021 17:43:44 +0000 (+0100) Subject: Add blog git setup. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/gitweb.css?a=commitdiff_plain;h=40a125d157cbac187384a31a93414e32a832ef58;p=config Add blog git setup. --- 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