From 5541e3c2ff441aea31940924ff952c968a77a30e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 14 Aug 2022 23:39:26 +0530 Subject: [PATCH] More robust cleaning of launcher dir --- setup.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f69b0840f..06f11fe4a 100755 --- a/setup.py +++ b/setup.py @@ -1354,6 +1354,14 @@ def repl(name: str, raw: str, defval: Union[str, float, FrozenSet[str]], val: Un # }}} +def clean_launcher_dir(launcher_dir: str) -> None: + for x in glob.glob(os.path.join(launcher_dir, 'kitty*')): + if os.path.isdir(x): + shutil.rmtree(x) + else: + os.remove(x) + + def clean() -> None: def safe_remove(*entries: str) -> None: @@ -1367,7 +1375,8 @@ def safe_remove(*entries: str) -> None: safe_remove( 'build', 'compile_commands.json', 'link_commands.json', 'linux-package', 'kitty.app', 'asan-launcher', - 'kitty-profile', 'kitty/launcher/kitty') + 'kitty-profile') + clean_launcher_dir('kitty/launcher') def excluded(root: str, d: str) -> bool: q = os.path.relpath(os.path.join(root, d), base).replace(os.sep, '/')