Skip to content

Commit

Permalink
Fix properly remove Sphinx build directories
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Apr 6, 2024
1 parent b345686 commit f90f8f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cleanpy/_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ def is_remove_entry(self, entry: DirEntry) -> Tuple[bool, Optional[RemoveTarget]
return (True, target)

if Category.BUILD in self.__include_categories:
# sphinx build path (docs/_build) is a special case
# because it is not a single directory name but a path.
if entry.name == "_build" and SPHINX_BUILD_TARGET.regexp.search(entry.path) is not None:
return (True, target)
return (True, SPHINX_BUILD_TARGET)

return (False, None)

Expand Down

0 comments on commit f90f8f8

Please sign in to comment.