summaryrefslogtreecommitdiffstats
path: root/build-website
diff options
context:
space:
mode:
Diffstat (limited to 'build-website')
-rwxr-xr-xbuild-website36
1 files changed, 35 insertions, 1 deletions
diff --git a/build-website b/build-website
index bb1590b..b7d0928 100755
--- a/build-website
+++ b/build-website
@@ -1,3 +1,37 @@
#!/bin/sh
-ikiwiki -setup ikiwiki.setup -refresh "$@"
+set -e
+set -u
+
+FATAL_SANITY_CHECK=yes
+
+# Parse arguments aimed at this wrapper, and drop them from $@ so we
+# can pass it on to ikiwiki.
+for arg in "${@}"; do
+ shift
+ if [ "${arg}" = --non-fatal-sanity-check ]; then
+ FATAL_SANITY_CHECK=no
+ continue
+ fi
+ set -- "${@}" "${arg}"
+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" \
+ "with the --non-fatal-sanity-check option" >&2
+ exit 1
+ fi
+fi
+
+# If I knew Ikiwiki better I'd probably figure out how to just make it
+# keep the misc/*.html files as-is instead of this hack.
+fixup_14962_workaround() {
+ mkdir -p config/chroot_local-includes/usr/share/doc/tails/website/misc
+ rm -f config/chroot_local-includes/usr/share/doc/tails/website/misc/*
+ cp wiki/src/misc/*.html \
+ config/chroot_local-includes/usr/share/doc/tails/website/misc
+}
+
+ikiwiki -setup ikiwiki.setup -refresh "$@" && fixup_14962_workaround