From bbaf50ac29356d6c7b7e3438408e5c7df3ac929d Mon Sep 17 00:00:00 2001 From: Amanjeev Sethi Date: Wed, 2 Oct 2019 18:06:30 -0400 Subject: [PATCH] Fix (build CI script): fails early if linkcheck fails --- ci/build.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ci/build.sh b/ci/build.sh index b0fae124..39548484 100755 --- a/ci/build.sh +++ b/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