Skip to content

Commit

Permalink
skip existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor committed Nov 2, 2023
1 parent af0dc89 commit 732017c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions convert_tonies_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
if len(yaml_dict["data"]) > 1:
print(f"article: {article}, with more than one entry")


with open(yaml_file_path, "w") as yaml_file:
yaml.dump(yaml_dict, yaml_file, default_flow_style=False, sort_keys=False, allow_unicode=True)
if os.path.exists(yaml_file_path):
pass # skip existing files
else:
with open(yaml_file_path, "w") as yaml_file:
yaml.dump(yaml_dict, yaml_file, default_flow_style=False, sort_keys=False, allow_unicode=True)

0 comments on commit 732017c

Please sign in to comment.