2017-02-13 17:32:53 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-02-25 09:23:51 +00:00
|
|
|
# Seeds sponge, from moreutils
|
|
|
|
|
|
|
|
#Validate all Jsons first
|
|
|
|
for dir in `find . -name "*.json"`
|
|
|
|
do
|
|
|
|
echo validating ${dir}
|
2018-10-12 08:34:13 +00:00
|
|
|
# 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();"
|
2017-02-25 09:23:51 +00:00
|
|
|
cat ${dir} | jq . >/dev/null
|
|
|
|
rc=$?
|
|
|
|
if [[ $rc != 0 ]]; then exit $rc; fi
|
|
|
|
done
|
|
|
|
|
2017-02-13 17:32:53 +00:00
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2017-02-13 17:52:54 +00:00
|
|
|
for dir in clusters/*.json
|
2017-02-13 17:32:53 +00:00
|
|
|
do
|
2017-02-25 09:23:51 +00:00
|
|
|
# Beautify it
|
2018-10-12 08:34:13 +00:00
|
|
|
cat ${dir} | jq --sort-keys . | sponge ${dir}
|
2017-02-13 17:32:53 +00:00
|
|
|
done
|
|
|
|
|
2017-02-14 09:19:20 +00:00
|
|
|
for dir in galaxies/*.json
|
|
|
|
do
|
2017-02-25 09:23:51 +00:00
|
|
|
# Beautify it
|
2018-10-12 08:34:13 +00:00
|
|
|
cat ${dir} | jq --sort-keys . | sponge ${dir}
|
2017-02-14 09:19:20 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
cat schema_clusters.json | jq . | sponge schema_clusters.json
|
|
|
|
cat schema_galaxies.json | jq . | sponge schema_galaxies.json
|