From 62deb71a8d7fd4f080b8a47eb6edb2510b4d79c1 Mon Sep 17 00:00:00 2001 From: Jay Caines-Gooby Date: Wed, 9 Mar 2022 17:59:46 +0000 Subject: [PATCH] Output valid JSON with the `--json` option Don't just print the data object, `json.dump` it --- exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter.py b/exporter.py index 611e9b6..e13a404 100755 --- a/exporter.py +++ b/exporter.py @@ -428,7 +428,7 @@ if __name__ == "__main__": def save(data, filename): if a.o is None: - print(data) + json.dump(data, sys.stdout, indent=4) else: out_dir_parent = os.path.abspath( os.path.expanduser(os.path.expandvars(a.o))