diff --git a/jq_all_the_things.sh b/jq_all_the_things.sh index f558cb3..9a43255 100755 --- a/jq_all_the_things.sh +++ b/jq_all_the_things.sh @@ -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