From 758eeb2d22aaef1d1e603f24273a334bf08554db Mon Sep 17 00:00:00 2001 From: CMDR-Kiel42 Date: Tue, 6 Aug 2019 10:55:28 +0200 Subject: [PATCH] Add cleanup to avoid having files both in package and main folder --- SpanshRouter/updater.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SpanshRouter/updater.py b/SpanshRouter/updater.py index e035268..e5859f1 100755 --- a/SpanshRouter/updater.py +++ b/SpanshRouter/updater.py @@ -38,6 +38,9 @@ class SpanshUpdater(): def install(self): if self.zip_downloaded: try: + # Cleaning up older versions + if os.path.exists(os.path.join(self.plugin_dir, "AutoCompleter.py")): + os.remove(os.path.join(self.plugin_dir, "*.py")) with zipfile.ZipFile(self.zip_path, 'r') as zip_ref: zip_ref.extractall(self.plugin_dir) @@ -45,4 +48,4 @@ class SpanshUpdater(): except NameError: exc_type, exc_value, exc_traceback = sys.exc_info() lines = traceback.format_exception(exc_type, exc_value, exc_traceback) - sys.stderr.write(''.join('!! ' + line for line in lines)) \ No newline at end of file + sys.stderr.write(''.join('!! ' + line for line in lines))