home · contact · privacy
Add dump blog (without uwsgi part).
[config] / buster / other_files / blog_hook_post-receive
1 #!/bin/sh
2 blog_dir=~/blog
3 export GIT_DIR=$(pwd)
4 export GIT_WORK_TREE="$blog_dir"
5 git checkout -f
6 cd "$GIT_WORK_TREE"
7 redo
8 git add metadata/author metadata/url metadata/title metadata/*.tmpl metadata/automatic_metadata captchas/linkable/*
9 count=$(ls -1 metadata/*.automatic_metadata 2>/dev/null | wc -l)
10 if [ "$count" != 0 ]; then
11   git add metadata/*.automatic_metadata
12 fi
13 status=$(git status -s)
14 n_updates=$(printf "$status" | grep -vE '^\?\?' | wc -l)
15 if [ "$n_updates" -gt 0 ]; then
16   git commit -a -m 'Update metadata'
17 fi