2016-10-21 09:19:33 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
-h|--help)
|
|
|
|
echo "--help, -h show this help message and exit"
|
|
|
|
echo "--loglevel=LEVEL, -L LEVEL log level (default: ERROR)"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
-L|--loglevel)
|
|
|
|
loglevel="$1 $2"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2017-06-15 04:15:47 +02:00
|
|
|
cd "$(dirname "$0")"/..
|
|
|
|
./tools/build-docs
|
|
|
|
cd ./tools/documentation_crawler
|
2016-10-21 09:19:33 +02:00
|
|
|
|
2016-10-25 20:41:12 +02:00
|
|
|
echo -en "\033[0;94m"
|
|
|
|
echo "Testing links in documentation..."
|
|
|
|
echo -en "\033[0m"
|
|
|
|
|
|
|
|
set +e
|
2016-10-21 09:19:33 +02:00
|
|
|
scrapy crawl_with_status documentation_crawler $loglevel
|
2016-10-25 20:41:12 +02:00
|
|
|
result=$?
|
|
|
|
if [ "$result" = 1 ]; then
|
|
|
|
echo -en "\033[0;91m"
|
|
|
|
echo "Failed!"
|
|
|
|
echo -en "\033[0m"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo -en "\033[0;92m"
|
|
|
|
echo "Passed!"
|
|
|
|
echo -en "\033[0m"
|
|
|
|
exit 0
|
|
|
|
fi
|