Skip to content

Commit

Permalink
Merge pull request #321 from stucka/patch-1
Browse files Browse the repository at this point in the history
Ensure directories are created before trying to write them.
  • Loading branch information
palewire authored Jan 19, 2022
2 parents b8bcee8 + 071f0fb commit f4b8758
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions warn/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
WARN_DATA_DIR = WARN_OUTPUT_DIR / "exports"
WARN_LOG_DIR = WARN_OUTPUT_DIR / "logs"

# Ensure needed directories exist
for localdir in [WARN_CACHE_DIR, WARN_DATA_DIR, WARN_LOG_DIR]:
os.makedirs(localdir, exist_ok=True)


def write_rows_to_csv(rows, output_path, mode="w"):
"""
Expand Down

0 comments on commit f4b8758

Please sign in to comment.