summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-03-14 22:24:38 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-03-14 22:26:38 -0400
commitee71849692690e9cd81852434f5babb5d63dc8bb (patch)
tree9f3a4bd7d52b212f0ed500253a88c32707bb6aa7 /bin
parentbde47bb5b29aae57f1cc682192bd31d2d9b477e4 (diff)
Run pre-generate server-side if it didn't already run
Diffstat (limited to 'bin')
-rwxr-xr-xbin/post-commit.githook1
-rwxr-xr-xbin/post-receive.githook12
2 files changed, 11 insertions, 2 deletions
diff --git a/bin/post-commit.githook b/bin/post-commit.githook
index 997afa3..5b05947 100755
--- a/bin/post-commit.githook
+++ b/bin/post-commit.githook
@@ -3,4 +3,3 @@ set -e
d="$(dirname -- "$(readlink -f -- "$0")")"
"$d"/auto-changelog
-"$d"/pre-generate &>/dev/tty &
diff --git a/bin/post-receive.githook b/bin/post-receive.githook
index 8292df0..53de38c 100755
--- a/bin/post-receive.githook
+++ b/bin/post-receive.githook
@@ -2,7 +2,17 @@
set -e
whoami
export LANG=en_US.UTF-8
-
unset GIT_DIR
+
+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