Fix (build CI script): fails early if linkcheck fails

This commit is contained in:
Amanjeev Sethi 2019-10-02 18:06:30 -04:00 committed by Who? Me?!
parent a6e1c86d8b
commit bbaf50ac29
1 changed files with 7 additions and 2 deletions

View File

@ -1,17 +1,22 @@
#!/bin/bash -x
set -o pipefail
output=$(mktemp)
mkdir -p book/
cp -r $HOME/linkcheck/ book/
RUST_LOG=mdbook_linkcheck=debug mdbook-linkcheck -s 2>&1 | tee -a $output
result=${PIPESTATUS[0]}
cp -r book/linkcheck $HOME/
mdbook build
result=${PIPESTATUS[0]}
# if passed, great!
if [ "$result" -eq "0" ] ; then
echo "Linkchecks passed"
exit 0 ;
else
echo "Linkchecks failed"
exit 1 ;
fi