From 3e2d38d34153861f0ae6947e6329307a9afdee03 Mon Sep 17 00:00:00 2001 From: Amanjeev Sethi Date: Wed, 2 Oct 2019 18:06:30 -0400 Subject: Fix (build CI script): fails early if linkcheck fails --- src/doc/rustc-dev-guide/ci/build.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/doc/rustc-dev-guide/ci') diff --git a/src/doc/rustc-dev-guide/ci/build.sh b/src/doc/rustc-dev-guide/ci/build.sh index b0fae1240b1..3954848419d 100755 --- a/src/doc/rustc-dev-guide/ci/build.sh +++ b/src/doc/rustc-dev-guide/ci/build.sh @@ -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 -- cgit 1.4.1-3-g733a5