From 3e8ef14e7e1a55eca57562e7b7d3a1b9392b9377 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Fri, 6 Mar 2015 09:43:01 +0100 Subject: [PATCH] Make linkchecker quiet unless errors are found --- docs/Makefile.am | 9 ++------- docs/checklinks.sh | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100755 docs/checklinks.sh diff --git a/docs/Makefile.am b/docs/Makefile.am index c8cff79f8e..34f81e31f5 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -48,13 +48,8 @@ endif if HAVE_LINKCHECKER check-links: html - linkchecker --anchors \ - --ignore-url=.eot$ \ - --ignore-url=\.svg \ - --ignore-url=mailto \ - --ignore-url=.ttf$ \ - --ignore-url=woff$ \ - html/index.html + ./checklinks.sh + endif clean: diff --git a/docs/checklinks.sh b/docs/checklinks.sh new file mode 100755 index 0000000000..60296b39e1 --- /dev/null +++ b/docs/checklinks.sh @@ -0,0 +1,19 @@ +#!/bin/sh +OUTPUT=$(linkchecker \ + --anchors \ + --ignore-url=.eot$ \ + --ignore-url=\.svg \ + --ignore-url=mailto \ + --ignore-url=.ttf$ \ + --ignore-url=woff$ \ + html/index.html 2>&1) + +if [ $? -ne 0 ]; then + echo "Errors in links detected, log follows:" + echo "$OUTPUT" + exit 1 +else + echo "Links OK!" + exit 0 +fi + -- 2.47.2