File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -780,17 +780,6 @@ def src_ignore(parent, entries):
780780
781781def clean ():
782782 os .chdir (os .path .dirname (os .path .abspath (__file__ )))
783- if os .path .exists ('.git' ):
784- for f in subprocess .check_output (
785- 'git ls-files --others --ignored --exclude-from=.gitignore' .split ()
786- ).decode ('utf-8' ).splitlines ():
787- if f .startswith ('logo/kitty.iconset' ) or f .startswith ('dev/' ):
788- continue
789- os .unlink (f )
790- if os .sep in f and not os .listdir (os .path .dirname (f )):
791- os .rmdir (os .path .dirname (f ))
792- return
793- # Not a git checkout, clean manually
794783
795784 def safe_remove (* entries ):
796785 for x in entries :
@@ -801,7 +790,9 @@ def safe_remove(*entries):
801790 os .unlink (x )
802791
803792 safe_remove ('build' , 'compile_commands.json' , 'linux-package' , 'kitty.app' )
804- for root , dirs , files in os .walk ('.' ):
793+ exclude = ('.git' ,)
794+ for root , dirs , files in os .walk ('.' , topdown = True ):
795+ dirs [:] = [d for d in dirs if d not in exclude ]
805796 remove_dirs = {d for d in dirs if d == '__pycache__' }
806797 [(shutil .rmtree (os .path .join (root , d )), dirs .remove (d )) for d in remove_dirs ]
807798 for f in files :
You can’t perform that action at this time.
0 commit comments