Skip to content

Commit 171f7f7

Browse files
amanjeevmark-i-m
authored andcommitted
Fix (build CI script): fails early if linkcheck fails
1 parent feb3229 commit 171f7f7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ci/build.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
#!/bin/bash -x
22

3+
set -o pipefail
4+
35
output=$(mktemp)
46

57
mkdir -p book/
68
cp -r $HOME/linkcheck/ book/
79
RUST_LOG=mdbook_linkcheck=debug mdbook-linkcheck -s 2>&1 | tee -a $output
10+
result=${PIPESTATUS[0]}
811
cp -r book/linkcheck $HOME/
912

1013
mdbook build
1114

12-
result=${PIPESTATUS[0]}
13-
1415
# if passed, great!
1516
if [ "$result" -eq "0" ] ; then
17+
echo "Linkchecks passed"
1618
exit 0 ;
19+
else
20+
echo "Linkchecks failed"
21+
exit 1 ;
1722
fi

0 commit comments

Comments
 (0)