mirror of
https://github.com/yeongpin/cursor-free-vip.git
synced 2025-08-02 20:47:35 +08:00
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.
This commit is contained in:
parent
386ffa4568
commit
63fe39f2c1
@ -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}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user