mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-13 12:09:35 +03:00
make clean should not clean bypy build artifacts
This commit is contained in:
parent
73f641cb66
commit
90164dfee7
10
setup.py
10
setup.py
@ -1145,9 +1145,13 @@ def clean() -> None:
|
||||
'build', 'compile_commands.json', 'link_commands.json',
|
||||
'linux-package', 'kitty.app', 'asan-launcher',
|
||||
'kitty-profile', 'kitty/launcher')
|
||||
exclude = ('.git',)
|
||||
for root, dirs, files in os.walk('.', topdown=True):
|
||||
dirs[:] = [d for d in dirs if d not in exclude]
|
||||
|
||||
def excluded(root: str, d: str) -> bool:
|
||||
q = os.path.relpath(os.path.join(root, d), base).replace(os.sep, '/')
|
||||
return q in ('.git', 'bypy/b')
|
||||
|
||||
for root, dirs, files in os.walk(base, topdown=True):
|
||||
dirs[:] = [d for d in dirs if not excluded(root, d)]
|
||||
remove_dirs = {d for d in dirs if d == '__pycache__' or d.endswith('.dSYM')}
|
||||
for d in remove_dirs:
|
||||
shutil.rmtree(os.path.join(root, d))
|
||||
|
Loading…
Reference in New Issue
Block a user