Skip to content

Commit

Permalink
Remove all generated files when cleaning docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Aug 7, 2023
1 parent 1d41f6f commit 861430f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ def build_docs(session: nox.Session) -> None:
@nox.session(python=False, name="clean-docs")
def clean_docs(session: nox.Session) -> None:
"""Clean up the docs folder."""
build_dir = ROOT / "docs" / "build"
docs_dir = ROOT / "docs"

if (build_dir / "html").is_dir():
with session.chdir(build_dir):
shutil.rmtree("html")
if (docs_dir / "build").is_dir():
with session.chdir(docs_dir):
shutil.rmtree("build")

if (ROOT / "build").is_dir():
session.chdir(ROOT / "build")
Expand All @@ -47,3 +47,5 @@ def clean_docs(session: nox.Session) -> None:
def nuke(session):
"""Run all clean sessions."""
clean_docs(session)
if (ROOT / "__pycache__").is_dir():
shutil.rmtree("__pycache__")

0 comments on commit 861430f

Please sign in to comment.