From 63fe39f2c17cdf973e90d33724cf432c1139bada Mon Sep 17 00:00:00 2001 From: yeongpin Date: Mon, 7 Apr 2025 10:53:06 +0800 Subject: [PATCH] fix: Update backup timestamp format in force update configuration - Changed the variable name from 'time' to 'current_time' for clarity. - Updated the backup file naming to use the current timestamp correctly, ensuring accurate backup creation. --- config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.py b/config.py index 71b67a4..e5839c8 100644 --- a/config.py +++ b/config.py @@ -4,6 +4,7 @@ import configparser from colorama import Fore, Style from utils import get_user_documents_path, get_default_chrome_path, get_linux_cursor_path import shutil +import datetime EMOJI = { "INFO": "ℹ️", @@ -269,13 +270,12 @@ def force_update_config(translator=None): try: config_dir = os.path.join(get_user_documents_path(), ".cursor-free-vip") config_file = os.path.join(config_dir, "config.ini") - datetime = datetime.datetime - time = datetime.now() + current_time = datetime.datetime.now() if os.path.exists(config_file): try: # create backup - backup_file = f"{config_file}.bak.{time.strftime('%Y%m%d_%H%M%S')}" + backup_file = f"{config_file}.bak.{current_time.strftime('%Y%m%d_%H%M%S')}" shutil.copy2(config_file, backup_file) if translator: print(f"{Fore.CYAN}{EMOJI['INFO']} {translator.get('config.backup_created', path=backup_file) if translator else f'Backup created: {backup_file}'}{Style.RESET_ALL}")