Skip to content

Commit

Permalink
python: Switch away from deprecated copy_tree API.
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun authored Oct 12, 2023
1 parent 961f49b commit 0d21375
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
"""

from pathlib import Path
from distutils.dir_util import copy_tree
import html
from shutil import copyfile
from shutil import copyfile, copytree

from .url import (
sanitize_stream,
Expand Down Expand Up @@ -111,10 +110,11 @@ def build_website(
page_footer_html,
)

# Copy the entire content of <repo_root>/assets into md_root.
# We use copy_tree from distutils instead of shutil.copytree so that it
# doesn't raise an error when assets/ already exists inside the md_root.
copy_tree(str(Path(repo_root) / "assets"), str(Path(md_root) / "assets"))
copytree(
str(Path(repo_root) / "assets"),
str(Path(md_root) / "assets"),
dirs_exist_ok=True,
)

# Copy .nojekyll into md_root as well.
copyfile(str(Path(repo_root) / ".nojekyll"), str(Path(md_root) / ".nojekyll"))
Expand Down

0 comments on commit 0d21375

Please sign in to comment.