misp-warninglists/validate_all.sh

32 lines
623 B
Bash
Raw Normal View History

2017-02-13 11:25:39 +01:00
#!/bin/bash
set -e
set -x
./jq_all_the_things.sh
diffs=`git status --porcelain | wc -l`
if ! [ $diffs -eq 0 ]; then
echo "Please make sure you run ./jq_all_the_things.sh before commiting."
exit 1
fi
2017-10-29 00:50:17 +02:00
# remove the exec flag on the json files
find -name "*.json" -exec chmod -x "{}" \;
diffs=`git status --porcelain | wc -l`
if ! [ $diffs -eq 0 ]; then
echo "Please make sure you run remove the executable flag on the json files before commiting: find -name "*.json" -exec chmod -x \"{}\" \\;"
exit 1
fi
2017-02-13 11:25:39 +01:00
for dir in lists/*/list.json
do
echo -n "${dir}: "
jsonschema -i ${dir} schema.json
echo ''
done