]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Make linkchecker quiet unless errors are found 2322/head
authorPieter Lexis <pieter@plexis.eu>
Fri, 6 Mar 2015 08:43:01 +0000 (09:43 +0100)
committerPieter Lexis <pieter@plexis.eu>
Fri, 6 Mar 2015 10:41:02 +0000 (11:41 +0100)
docs/Makefile.am
docs/checklinks.sh [new file with mode: 0755]

index c8cff79f8ecdbc85389e4fad02a9ffb0a0a2e6f1..34f81e31f5a51438c691bf466a2b421fedf5d572 100644 (file)
@@ -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 (executable)
index 0000000..60296b3
--- /dev/null
@@ -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
+