diff options
| author | John MacFarlane <[email protected]> | 2023-12-18 12:21:00 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2023-12-18 12:21:00 -0800 |
| commit | 4db6661fe50902939e7856f42b2843b27d5abad8 (patch) | |
| tree | 95f6f88684796af81103f8b544a0f69f7211c40d /tools | |
| parent | 0849baef1e6844c85956e4e56db681d78af1b5cc (diff) | |
validate-docx.sh: print list of files that fail validation.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/validate-docx.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/validate-docx.sh b/tools/validate-docx.sh index 99874111b..d27d8c5a0 100644 --- a/tools/validate-docx.sh +++ b/tools/validate-docx.sh @@ -3,8 +3,10 @@ # to look at more files than just document.xml. # Further modified by jgm for portability. tmpdir=$(mktemp -d) +error_files="" errors=0 for file in "$@"; do + file_errors=0 echo "*** Checking $file" rm -rf "$tmpdir" unzip -q -o -j "$file" -d "$tmpdir" @@ -15,7 +17,14 @@ for file in "$@"; do for i in "$tmpdir"/*-pretty.xml; do xmllint -noout -nonet \ -schema "${XSD}" \ - "${i}" 2>&1 || errors=$((errors + 1)) + "${i}" 2>&1 || file_errors=$((file_errors + 1)) done + if [ $file_errors -gt 0 ]; then + errors=$((file_errors + errors)) + error_files="$error_files\n$file" + fi done +if [ $errors -gt 0 ]; then + echo "These files failed validation:$error_files" +fi exit $errors |
