-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathproof_html.sh
executable file
·34 lines (32 loc) · 1.07 KB
/
proof_html.sh
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
29
30
31
32
33
34
#!/bin/bash
#set -e # Need to fail on error
set +e # Do not fail on error for now, we are stil building
#
# Prerequisites
# apt-get update -y
# apt-get install python3-pip libcurl4 -y
# pip3 install html5validator
# gem install --no-document html-proofer
TIDY_OUT=/tmp/tidy_out.$$
echo "*** Internal link check ***"
export LANG=en_US.UTF-8
htmlproofer \
--disable_external \
--allow-hash-href \
--ignore-urls="" \
--ignore-files="out/admin/index.html" \
out
(
find out -path out/admin -prune -o -name "*.html" -exec html5validator "{}" \;
) | tee $TIDY_OUT
ERRORS=$( grep 'error:' $TIDY_OUT | wc -l )
if [[ $ERRORS -gt 0 ]] ; then
echo "------------------------------------------------------------------------------------"
echo "There are $ERRORS errors in html files, not good enough!"
grep 'Error:' $TIDY_OUT
exit 1
else
echo "------------------------------------------------------------------------------------"
echo " HTML checked and found flawles, \0/ \0/ \0/ \0/ \0/ \0/ "
echo "------------------------------------------------------------------------------------"
fi