From: Georgios Atheridis Date: Wed, 1 Jun 2022 11:25:05 +0000 (+0300) Subject: Fixed a bug where adding an account replaced the main.py file X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=2981de038c4f835d873d0ac3e91254ff9d8c9f49;p=personal%2Faptbot.git Fixed a bug where adding an account replaced the main.py file --- diff --git a/aptbot/args_logic.py b/aptbot/args_logic.py index 8d143a2..3f71563 100644 --- a/aptbot/args_logic.py +++ b/aptbot/args_logic.py @@ -24,10 +24,13 @@ def add_account(s: socket.socket, acc: str): pass os.makedirs(account_path, exist_ok=True) - shutil.copyfile( - os.path.join(os.path.dirname(os.path.realpath(__file__)), "resources/main.py"), - os.path.join(account_path, "main.py"), - ) + if not os.path.exists(os.path.join(account_path, "main.py")): + shutil.copyfile( + os.path.join( + os.path.dirname(os.path.realpath(__file__)), "resources/main.py" + ), + os.path.join(account_path, "main.py"), + ) command = BotCommands.JOIN.value channel = acc