Mercurial > hg > piper
view json/check.sh @ 196:9a36c8850b1b
More docs.
I didn't like the layout with the comment lines below the definitions,
so I'm breaking my usual rule and going to 130 character width.
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Thu, 09 Feb 2017 19:00:11 +0000 |
parents | 549d3d44d729 |
children |
line wrap: on
line source
#!/bin/bash mydir=$(dirname "$0") set -eu echo for ex in "$mydir"/examples/*.json ; do echo "Checking $ex..." 1>&2 jsonschema -i "$ex" "$mydir"/schema/$(basename "$ex" | sed 's/-[^.]*//') done for s in "$mydir"/schema/*.json ; do if [ ! -f "$mydir"/examples/$(basename "$s") ]; then if ! ls -1 "$mydir"/examples/$(basename "$s" .json)-*.json >/dev/null 2>&1; then echo "WARNING: No example file for schema $s" fi fi done echo OK