mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-04 12:10:16 +03:00
Exclude __pycache__ dirs for project generation
This commit is contained in:
parent
d19f22967f
commit
2bcf200ea8
|
@ -151,10 +151,11 @@ def _fixture_id(ctx):
|
||||||
|
|
||||||
def build_files_list(base_path: Path):
|
def build_files_list(base_path: Path):
|
||||||
"""Build a list containing absolute paths to the generated files."""
|
"""Build a list containing absolute paths to the generated files."""
|
||||||
|
excluded_dirs = {".venv", "__pycache__"}
|
||||||
|
|
||||||
f = []
|
f = []
|
||||||
for dirpath, subdirs, files in base_path.walk():
|
for dirpath, subdirs, files in base_path.walk():
|
||||||
if ".venv" in subdirs:
|
subdirs[:] = [d for d in subdirs if d not in excluded_dirs]
|
||||||
subdirs.remove(".venv")
|
|
||||||
|
|
||||||
for file_path in files:
|
for file_path in files:
|
||||||
f.append(dirpath / file_path)
|
f.append(dirpath / file_path)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user