2022-06-03 00:18:13 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# filters the Nu HTML Validator's JSON output. Operates on stdin.
|
2023-11-25 21:41:35 +00:00
|
|
|
# no pipefail here since there are no pipes.
|
2022-06-03 00:18:13 +00:00
|
|
|
set -e -u
|
|
|
|
|
|
|
|
root_dir="$(dirname "$0")/.."
|
2023-08-27 21:26:33 +00:00
|
|
|
vnu_output="$(jaq --from-file "$root_dir/linter-configs/vnu_filter.jq")"
|
2022-06-03 00:18:13 +00:00
|
|
|
if [ "$vnu_output" = '' ]; then
|
|
|
|
echo "All markup is valid"
|
2023-11-25 21:41:35 +00:00
|
|
|
exit 0
|
2022-06-03 00:18:13 +00:00
|
|
|
fi
|
2023-11-25 21:41:35 +00:00
|
|
|
echo "Markup errors found!" 1>&2
|
|
|
|
echo "$vnu_output"
|
|
|
|
exit 1
|