Skip to content

Commit

Permalink
fix: automatically add suffix to config-file
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianMichelsen committed Oct 17, 2022
1 parent bc233c7 commit 75fcb19
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/metaDMG/cli/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,9 @@ def save_config_file(
print("Exiting")
raise typer.Abort()

if not ("yaml" in config_file.name or "yml" in config_file.name):
config_file = config_file.with_suffix(".yaml")

with open(config_file, "w") as file:
yaml.dump(config, file, sort_keys=False)
if verbose:
Expand Down

0 comments on commit 75fcb19

Please sign in to comment.