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