1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-14 01:32:11 +00:00
seirdy.one/scripts/filter-vnu.sh

15 lines
365 B
Bash
Raw Normal View History

#!/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.
set -e -u
root_dir="$(dirname "$0")/.."
vnu_output="$(jaq --from-file "$root_dir/linter-configs/vnu_filter.jq")"
if [ "$vnu_output" = '' ]; then
echo "All markup is valid"
2023-11-25 21:41:35 +00:00
exit 0
fi
2023-11-25 21:41:35 +00:00
echo "Markup errors found!" 1>&2
echo "$vnu_output"
exit 1