3
3
dir=$( cd " $( dirname " $0 " ) /.." && pwd)
4
4
bin=" $dir /_bin"
5
5
root=" $dir /_site"
6
- any_failed =0
6
+ failed =0
7
7
test -d " $root " || {
8
8
echo " Please generate the site first."
9
9
echo " bundle exec jekyll serve"
@@ -12,37 +12,60 @@ test -d "$root" || {
12
12
13
13
echo " [Checking page generation]"
14
14
" $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
17
20
18
21
echo
19
22
echo " [Checking user IDs]"
20
23
" $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
+
23
30
24
31
echo
25
32
echo " [Checking include usage]"
26
33
" $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
+
29
40
30
41
echo
31
42
echo " [Checking include documentation]"
32
43
" $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
+
35
50
36
51
echo
37
52
echo " [Checking HTML element id values]"
38
53
" $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
+
41
60
42
61
# echo
43
62
# echo "[Checking site HTML]"
44
63
# "$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
47
69
48
- exit $any_failed
70
+ echo " $failed checks failed."
71
+ exit $failed
0 commit comments