mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 14:46:03 +00:00
Never delete any files in the .git directory when cleaning manually
This is how results can be removed from os.walk(), according to https://docs.python.org/3/library/os.html#os.walk.
This commit is contained in:
parent
0e1a423889
commit
3ea3a85694
1 changed files with 3 additions and 1 deletions
4
setup.py
4
setup.py
|
|
@ -790,7 +790,9 @@ def clean():
|
|||
os.unlink(x)
|
||||
|
||||
safe_remove('build', 'compile_commands.json', 'linux-package', 'kitty.app')
|
||||
for root, dirs, files in os.walk('.'):
|
||||
exclude = ('.git',)
|
||||
for root, dirs, files in os.walk('.', topdown=True):
|
||||
dirs[:] = [d for d in dirs if d not in exclude]
|
||||
remove_dirs = {d for d in dirs if d == '__pycache__'}
|
||||
[(shutil.rmtree(os.path.join(root, d)), dirs.remove(d)) for d in remove_dirs]
|
||||
for f in files:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue