33dir=$( cd " $( dirname " $0 " ) /.." && pwd)
44bin=" $dir /_bin"
55root=" $dir /_site"
6- any_failed =0
6+ failed =0
77test -d " $root " || {
88 echo " Please generate the site first."
99 echo " bundle exec jekyll serve"
@@ -12,37 +12,60 @@ test -d "$root" || {
1212
1313echo " [Checking page generation]"
1414" $bin /check-page-generation.sh"
15- test $? -eq 0 && echo " --> Page generation looks good."
16- test $? -neq 0 && any_failed=1
15+ if [ $? -ne 0 ]; then
16+ failed=$(( failed+ 1 ))
17+ else
18+ echo " --> Page generation looks good."
19+ fi
1720
1821echo
1922echo " [Checking user IDs]"
2023" $bin /check-user-ids.sh"
21- test $? -eq 0 && echo " --> User IDs look good."
22- test $? -neq 0 && any_failed=1
24+ if [ $? -ne 0 ]; then
25+ failed=$(( failed+ 1 ))
26+ else
27+ echo " --> User IDs look good."
28+ fi
29+
2330
2431echo
2532echo " [Checking include usage]"
2633" $bin /check-include-usage.sh"
27- test $? -eq 0 && echo " --> Includes look good."
28- test $? -neq 0 && any_failed=1
34+ if [ $? -ne 0 ]; then
35+ failed=$(( failed+ 1 ))
36+ else
37+ echo " --> Includes look good."
38+ fi
39+
2940
3041echo
3142echo " [Checking include documentation]"
3243" $bin /check-include-help.sh"
33- test $? -eq 0 && echo " --> Include docs look good."
34- test $? -neq 0 && any_failed=1
44+ if [ $? -ne 0 ]; then
45+ failed=$(( failed+ 1 ))
46+ else
47+ echo " --> Include docs look good."
48+ fi
49+
3550
3651echo
3752echo " [Checking HTML element id values]"
3853" $bin /check-html-ids.sh"
39- test $? -eq 0 && echo " --> HTML element ids look good."
40- test $? -neq 0 && any_failed=1
54+ if [ $? -ne 0 ]; then
55+ failed=$(( failed+ 1 ))
56+ else
57+ echo " --> HTML element ids look good."
58+ fi
59+
4160
4261# echo
4362# echo "[Checking site HTML]"
4463# "$bin/check-site-html.sh"
45- # test $? -eq 0 && echo "--> Site HTML looks good! Congratulations."
46- # test $? -neq 0 && any_failed=1
64+ # if [ $? -ne 0 ]; then
65+ # failed=$((failed+1))
66+ # else
67+ # echo "--> Site HTML looks good! Congratulations."
68+ # fi
4769
48- exit $any_failed
70+ echo " $failed checks failed."
71+ exit $failed
0 commit comments