build-website 664 Bytes
Newer Older
1 2
#!/bin/sh

3 4 5 6 7
set -e
set -u

FATAL_SANITY_CHECK=yes

anonym's avatar
anonym committed
8
# Parse arguments aimed at this wrapper, and drop them from $@ so we
9 10 11 12 13 14 15
# can pass it on to ikiwiki.
for arg in "${@}"; do
    shift
    if [ "${arg}" = --non-fatal-sanity-check ]; then
        FATAL_SANITY_CHECK=no
        continue
    fi
16
    set -- "${@}" "${arg}"
17 18 19 20 21 22
done

git_dir="$(git rev-parse --show-toplevel)"
if ! "${git_dir}/bin/sanity-check-website" ; then
    if [ "${FATAL_SANITY_CHECK}" != no ]; then
        echo "Some pages in our wiki are bad! Please fix them or re-run" \
anonym's avatar
anonym committed
23
             "with the --non-fatal-sanity-check option" >&2
24 25 26 27
        exit 1
    fi
fi

28
ikiwiki -setup ikiwiki.setup -refresh "$@"