Skip to content

Commit c7d5b43

Browse files
committed
Improve purge to clean up unrecognised directories
1 parent 55390c5 commit c7d5b43

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/manage/uninstall_command.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ def execute(cmd):
108108
for _, cleanup in SHORTCUT_HANDLERS.values():
109109
if cleanup:
110110
cleanup(cmd, [])
111+
# Clean up other lingering directories
112+
LOGGER.info("Purging remaining files")
113+
for d in cmd.install_dir.listdir():
114+
if d.is_dir():
115+
LOGGER.verbose("Removing %s", d)
116+
rmtree(d, after_5s_warning=warn_msg.format("remaining files"))
117+
if any(cmd.install_dir.listdir()):
118+
LOGGER.warn("Unable to fully remove %s.", cmd.install_dir)
111119
LOGGER.debug("END uninstall_command.execute")
112120
return
113121

0 commit comments

Comments
 (0)