Last active
June 10, 2020 09:21
-
-
Save thebabush/db1edf57769139bd1978787530c7ebe8 to your computer and use it in GitHub Desktop.
bash/python one-liner to merge all compile_commands.json files in a directory tree
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
python3 -c 'import json; import glob; import itertools; print(json.dumps(list(itertools.chain(*[json.load(open(f, "rb")) for f in glob.glob("**/compile_commands.json", recursive=True)])), indent=4))' > ../compile_commands.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note to self: do not redirect into a file in the current directory tree