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