fix jq_all_the_things script

pull/141/head
Deborah Servili 2019-01-28 16:06:05 +01:00
parent db6297131f
commit b4c2de001c
No known key found for this signature in database
GPG Key ID: 7E3A832850D4D7D1
1 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,17 @@
#!/bin/bash
# Seeds sponge, from moreutils
#Validate all Jsons first
for dir in `find . -name "*.json"`
do
echo validating ${dir}
# python3 -c "import json; f_in = open('${dir}'); data = json.load(f_in); f_in.close(); f_out = open('${dir}', 'w'); json.dump(data, f_out, indent=2, sort_keys=True, ensure_ascii=False); f_out.close();"
cat ${dir} | jq . >/dev/null
rc=$?
if [[ $rc != 0 ]]; then exit $rc; fi
done
set -e
set -x