#!/usr/bin/env python
"""Clean up crawl output for a fresh run. Run before each test attempt."""
from __future__ import annotations

import shutil
from pathlib import Path

OUT = Path(r"D:\repos\crawler\sites_crawled\www.prolicht.at")
COOKIES = Path(r"D:\repos\crawler\app\cookies\www.prolicht.at.json")
LOG = Path(r"D:\repos\crawler\app\crawler.log")


def main() -> None:
    if OUT.exists():
        shutil.rmtree(OUT)
        print(f"Removed {OUT}")
    else:
        print(f"No output dir at {OUT}")

    if COOKIES.exists():
        COOKIES.unlink()
        print(f"Removed {COOKIES}")

    if LOG.exists():
        LOG.unlink()
        print(f"Removed {LOG}")

    print("Ready for fresh run.")


if __name__ == "__main__":
    main()
