Skip to content

Commit

Permalink
refactor: Improve experience for Windows users
Browse files Browse the repository at this point in the history
Use `shutil.copytree` instead of `cp`, and `shutil.rmtree` instead of `rm`, as Windows environments may not have these commands.

PR-33: #33
  • Loading branch information
blairconrad authored Oct 25, 2024
1 parent c0dbb46 commit ece7662
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions project/scripts/make
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def clean() -> None:
"""Delete build artifacts and cache files."""
paths_to_clean = ["build", "dist", "htmlcov", "site", ".coverage*", ".pdm-build"]
for path in paths_to_clean:
shell(f"rm -rf {path}")
shutil.rmtree(path, ignore_errors=True)

cache_dirs = {".cache", ".pytest_cache", ".mypy_cache", ".ruff_cache", "__pycache__"}
for dirpath in Path(".").rglob("*/"):
Expand All @@ -109,8 +109,7 @@ def clean() -> None:

def vscode() -> None:
"""Configure VSCode to work on this project."""
Path(".vscode").mkdir(parents=True, exist_ok=True)
shell("cp -v config/vscode/* .vscode")
shutil.copytree("config/vscode", ".vscode", dirs_exist_ok=True)


def main() -> int:
Expand Down

0 comments on commit ece7662

Please sign in to comment.