Skip to content

Commit b72665d

Browse files
committed
only writes the final json if there is a current_type for download
1 parent 42033d9 commit b72665d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

icekube/cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ def download(output_dir: str):
9292
if resource.raw:
9393
current_group.append(json.loads(resource.raw))
9494

95-
with open(path / f"{current_type}.json", "w") as fs:
96-
fs.write(json.dumps(current_group, indent=4, default=str))
95+
if current_type:
96+
with open(path / f"{current_type}.json", "w") as fs:
97+
fs.write(json.dumps(current_group, indent=4, default=str))
9798

9899

99100
@app.command()

0 commit comments

Comments
 (0)