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',
|
'build', 'compile_commands.json', 'link_commands.json',
|
||||||
'linux-package', 'kitty.app', 'asan-launcher',
|
'linux-package', 'kitty.app', 'asan-launcher',
|
||||||
'kitty-profile', 'kitty/launcher')
|
'kitty-profile', 'kitty/launcher')
|
||||||
exclude = ('.git',)
|
|
||||||
for root, dirs, files in os.walk('.', topdown=True):
|
def excluded(root: str, d: str) -> bool:
|
||||||
dirs[:] = [d for d in dirs if d not in exclude]
|
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')}
|
remove_dirs = {d for d in dirs if d == '__pycache__' or d.endswith('.dSYM')}
|
||||||
for d in remove_dirs:
|
for d in remove_dirs:
|
||||||
shutil.rmtree(os.path.join(root, d))
|
shutil.rmtree(os.path.join(root, d))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user