Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def _remove_superfluous_paths():
"""Removes superfluous files and directories."""
optional_paths = [(re.compile(path), keep) for path, keep in OPTIONAL_PATHS]
rootdir = "."
for dirpath, dirnames, filenames in os.walk(rootdir):
for pathname in dirnames + filenames:
fullpath = os.path.join(dirpath, pathname)
for pattern, keep in optional_paths:
for pattern, keep in optional_paths:
for dirpath, dirnames, filenames in os.walk(rootdir):
for pathname in dirnames + filenames:
fullpath = os.path.join(dirpath, pathname)
if pattern.match(fullpath):
if not keep:
if os.path.isfile(fullpath):
Expand Down