summaryrefslogtreecommitdiff
path: root/bin/post-receive.githook
blob: ddd74c3ff2ae69779b0795132e02515d1db59891 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
set -e
whoami
export LANG=en_US.UTF-8
unset GIT_DIR

if ! type scss; then
	. ~/.profile
fi

if ! git merge-base --is-ancestor master pre-generated; then
	dir="$(mktemp --tmpdir -d www-generate.XXXXXXXXXX)"
	git clone "$PWD" "$dir"
	pushd "$dir"
	bin/pre-generate
	git push origin pre-generated
	popd
	rm -rf -- "$dir"
fi

cd /srv/http/www.andrewdm.me
git pull --ff-only