Don't remove AddOn download_dir on uninstall, do it in CLI's remove instead.

This commit is contained in:
Casper V. Kristensen 2019-10-11 02:08:50 +02:00
parent 7a0114b50c
commit d9e6ca1317
Signed by: caspervk
GPG key ID: 289CA03790535054
2 changed files with 1 additions and 1 deletions

View file

@ -86,7 +86,6 @@ class Addon:
def uninstall(self) -> None: def uninstall(self) -> None:
logger.info("Uninstalling %s", self) logger.info("Uninstalling %s", self)
shutil.rmtree(self.download_dir, ignore_errors=True)
for dir in self.dirs: for dir in self.dirs:
shutil.rmtree(config.ADDONS_DIR.joinpath(dir.name), ignore_errors=True) shutil.rmtree(config.ADDONS_DIR.joinpath(dir.name), ignore_errors=True)

View file

@ -120,6 +120,7 @@ class CLI:
for addon in remove: for addon in remove:
print(f"Removing {addon.name}") print(f"Removing {addon.name}")
addon.uninstall() addon.uninstall()
shutil.rmtree(addon.download_dir, ignore_errors=True)
self.installed_addons.remove(addon) self.installed_addons.remove(addon)
addons.save_installed_addons(self.installed_addons) addons.save_installed_addons(self.installed_addons)