summaryrefslogtreecommitdiff
path: root/hooks/post-receive
blob: 58d831e7215a60db94c007f8235990c22574e11e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

# This hook will update the static website whenever with new commits on each push.

export LC_TYPE="en_US.UTF-8"

www="/var/www/git"
src="$(pwd)"
name=$(basename "$src")
dst="$www/$(basename "$name" '.git')"

[ ! -d dst ] && mkdir -p "$dst"
cd "$dst" || exit 1

echo "[stagit] building $dst"
stagit "$src"

echo "[stagit] linking $dst"
ln -sf log.html index.html
ln -sf ../style.css style.css
ln -sf ../logo.png logo.png