fix jq_all_the_things script

pull/130/head
Deborah Servili 2019-01-28 16:10:11 +01:00
parent 3fd907df6b
commit 932356b41b
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 #!/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 -e
set -x set -x