forked from rust-lang/reference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinkcheck.sh
More file actions
executable file
·28 lines (20 loc) · 761 Bytes
/
linkcheck.sh
File metadata and controls
executable file
·28 lines (20 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
set -e
if [ ! -f book.toml ]
then
echo "Run command in root directory with book.toml"
exit 1
fi
rm -rf tests/linkcheck tests/linkchecker
mkdir tests/linkchecker
curl -o tests/linkchecker/Cargo.toml \
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/Cargo.toml
curl -o tests/linkchecker/main.rs \
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/main.rs
mdbook build
cp -R $(rustc --print sysroot)/share/doc/rust/html tests/linkcheck
rm -rf tests/linkcheck/reference
cp -R book tests/linkcheck/reference
cargo run --manifest-path=tests/linkchecker/Cargo.toml -- tests/linkcheck/reference
rm -rf tests/linkcheck tests/linkchecker
echo "Linkcheck completed successfully!"