Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
misp-taxonomies/jq_all_the_things.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
27 lines (21 sloc)
700 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# Seeds sponge, from moreutils | |
for dir in ./*/machinetag.json | |
do | |
cat ${dir} | jq . | sponge ${dir} | |
done | |
cat schema.json | jq . | sponge schema.json | |
cat schema_mapping.json | jq . | sponge schema_mapping.json | |
cat MANIFEST.json | jq . | sponge MANIFEST.json |