From b72665d9b951c5cc64f0d08e8cebfcdb1e275b08 Mon Sep 17 00:00:00 2001 From: Mohit Gupta Date: Fri, 1 Dec 2023 01:40:20 +0000 Subject: [PATCH] only writes the final json if there is a current_type for download --- icekube/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/icekube/cli.py b/icekube/cli.py index 1413e50..5cb100d 100644 --- a/icekube/cli.py +++ b/icekube/cli.py @@ -92,8 +92,9 @@ def download(output_dir: str): if resource.raw: current_group.append(json.loads(resource.raw)) - with open(path / f"{current_type}.json", "w") as fs: - fs.write(json.dumps(current_group, indent=4, default=str)) + if current_type: + with open(path / f"{current_type}.json", "w") as fs: + fs.write(json.dumps(current_group, indent=4, default=str)) @app.command()