entitydb/test.sh

24 lines
387 B
Bash
Raw Permalink Normal View History

2022-01-17 19:36:02 +00:00
#!/bin/bash
2021-10-31 11:20:08 +00:00
# Primitive testing script to check that the JSONs are valid.
if ! jq --version &> /dev/null; then
echo "You need to install jq to run this script"
exit 1
fi
2021-10-31 11:20:08 +00:00
ret=0
for file in *.json; do
if ! jq --exit-status '.route | .[] | .device' < "$file" > /dev/null 2>&1
2021-10-31 11:20:08 +00:00
then
echo "$file is invalid." >&2
2021-10-31 11:20:08 +00:00
ret=1
else
#echo "$file is valid."
:
2021-10-31 11:20:08 +00:00
fi
done
2021-10-31 11:20:08 +00:00
exit $ret