OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
2 | 5 |
3 # simple script to check html via tidy. Either specify html files on | 6 # simple script to check html via tidy. Either specify html files on |
4 # command line or rely on default which checks all html files in | 7 # command line or rely on default which checks all html files in |
5 # current directory | 8 # current directory |
6 set -o nounset | 9 set -o nounset |
7 set -o errexit | 10 set -o errexit |
8 | 11 |
9 | 12 |
10 CheckFile () { | 13 CheckFile () { |
11 echo "========================================" | 14 echo "========================================" |
12 echo "checking $1" | 15 echo "checking $1" |
13 echo "========================================" | 16 echo "========================================" |
14 tidy -e -q $1 | 17 tidy -e -q $1 |
15 } | 18 } |
16 | 19 |
17 | 20 |
18 if [ $# -eq 0 ] ; then | 21 if [ $# -eq 0 ] ; then |
19 for file in *.html ; do | 22 for file in *.html ; do |
20 CheckFile ${file} | 23 CheckFile ${file} |
21 done | 24 done |
22 else | 25 else |
23 for file in $* ; do | 26 for file in $* ; do |
24 CheckFile ${file} | 27 CheckFile ${file} |
25 done | 28 done |
26 fi | 29 fi |
OLD | NEW |