mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-10 03:01:14 +03:00
Merge branch 'manual_cleaning' of https://github.com/Luflosi/kitty
This commit is contained in:
commit
ba1c093d18
15
setup.py
15
setup.py
@ -780,17 +780,6 @@ Categories=System;TerminalEmulator;
|
||||
|
||||
def clean():
|
||||
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
||||
if os.path.exists('.git'):
|
||||
for f in subprocess.check_output(
|
||||
'git ls-files --others --ignored --exclude-from=.gitignore'.split()
|
||||
).decode('utf-8').splitlines():
|
||||
if f.startswith('logo/kitty.iconset') or f.startswith('dev/'):
|
||||
continue
|
||||
os.unlink(f)
|
||||
if os.sep in f and not os.listdir(os.path.dirname(f)):
|
||||
os.rmdir(os.path.dirname(f))
|
||||
return
|
||||
# Not a git checkout, clean manually
|
||||
|
||||
def safe_remove(*entries):
|
||||
for x in entries:
|
||||
@ -801,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…
Reference in New Issue
Block a user