diff --git a/warn/utils.py b/warn/utils.py index b77259c1..e3cace90 100644 --- a/warn/utils.py +++ b/warn/utils.py @@ -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"): """