Skip to content

Commit

Permalink
only writes the final json if there is a current_type for download
Browse files Browse the repository at this point in the history
  • Loading branch information
Skybound1 committed Dec 1, 2023
1 parent 42033d9 commit b72665d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions icekube/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b72665d

Please sign in to comment.