#!/bin/sh
set -eu

doc_dir=/usr/share/doc/python-tooz-doc/html
test -f "$doc_dir/index.html"
if grep -rl --include='*.html' 'googletagmanager\.com' "$doc_dir"; then
    exit 1
else
    test "$?" -eq 1
fi

# The Ubuntu theme still copies its own JavaScript into the output.
for asset in bootstrap.bundle.min.js jquery-3.2.1.min.js; do
    test -L "$doc_dir/_static/js/$asset"
    test -f "$doc_dir/_static/js/$asset"
done
