#!/bin/sh -ex
trap 'rm -rf "$tmp"' INT TERM EXIT HUP
tmp=$(git-hooks-workdir "$@")

cd "$tmp/doc"
notwiki-doc html /srv/http/vhost/code/ics2txt .
notwiki-doc gph /srv/gopher/ics2txt .
notwiki-mandoc html html /srv/http/vhost/code/man .
notwiki-mandoc gph utf8 /srv/gopher/man .

cd "$tmp"
make dist
cp *.tar.gz /srv/http/vhost/code/ics2txt
cp *.tar.gz /srv/gopher/ics2txt
