| 1 | #! /usr/bin/env bash |
| 2 | |
| 3 | # Script to build rust docs. |
| 4 | # |
| 5 | # Usage: ./ci/docs.sh [open] |
| 6 | |
| 7 | set -e |
| 8 | |
| 9 | arg1="$1" |
| 10 | |
| 11 | # Install Rust nightly. |
| 12 | rustup install nightly |
| 13 | |
| 14 | export RUSTDOCFLAGS='--cfg docsrs' |
| 15 | export DOCS_RS=1 |
| 16 | |
| 17 | if [ "$arg1" = "open" ]; then |
| 18 | cargo +nightly doc --no-deps --open |
| 19 | else |
| 20 | cargo +nightly doc --no-deps |
| 21 | |
| 22 | # Add an index.html file that redirects to our main page. |
| 23 | if [ ! -f "target/doc/index.html" ]; then |
| 24 | echo '<meta http-equiv=refresh content=0;url=exacl/index.html>' >"target/doc/index.html" |
| 25 | fi |
| 26 | fi |
| 27 | |
| 28 | exit 0 |