CI dox
diff --git a/ci/dox.sh b/ci/dox.sh
index a003dc3..6edcb15 100644
--- a/ci/dox.sh
+++ b/ci/dox.sh
@@ -1,14 +1,18 @@
#!/bin/sh
+# Builds documentation for all target triples that we have a registered URL for
+# in liblibc. This scrapes the list of triples to document from `src/lib.rs`
+# which has a bunch of `html_root_url` directives we pick up.
+
set -e
+TARGETS=`grep html_root_url src/lib.rs | sed 's/.*".*\/\(.*\)"/\1/'`
+
rm -rf target/doc
mkdir -p target/doc
cp ci/landing-page-head.html target/doc/index.html
-TARGETS=`grep html_root_url src/lib.rs | sed 's/.*".*\/\(.*\)"/\1/'`
-
for target in $TARGETS; do
echo documenting $target
@@ -21,7 +25,8 @@
cat ci/landing-page-footer.html >> target/doc/index.html
-if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "autotest" ]; then
+# If we're on travis, not a PR, and on the right branch, publish!
+if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
pip install ghp-import --user $USER
$HOME/.local/bin/ghp-import -n target/doc
git push -qf https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages