I have several json files I want to combine. Some are arrays of objects and some are single objects. I want to effectively concatenate all of this into a single array.
For example:
[ { "name": "file1" } ] { "name": "file2" } { "name": "file3" } And I want to end up with:
[ { "name": "file1" } { "name": "file2" }, { "name": "file3" }, ] How can I do this using jq or similar?
jq -n '[inputs] | add' $(find . -name '*.json') > combined.json