mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
commit
5fd687c1e4
@ -162,7 +162,7 @@ def _file_handle(latest_version: str) -> str:
|
|||||||
if backup_file.exists():
|
if backup_file.exists():
|
||||||
backup_file.unlink()
|
backup_file.unlink()
|
||||||
if file not in [config_file, config_path_file]:
|
if file not in [config_file, config_path_file]:
|
||||||
os.rename(file.absolute(), backup_file.absolute())
|
shutil.move(file.absolute(), backup_file.absolute())
|
||||||
else:
|
else:
|
||||||
with open(file, "r", encoding="utf8") as rf:
|
with open(file, "r", encoding="utf8") as rf:
|
||||||
data = rf.read()
|
data = rf.read()
|
||||||
@ -174,7 +174,7 @@ def _file_handle(latest_version: str) -> str:
|
|||||||
old_file = Path() / file
|
old_file = Path() / file
|
||||||
if old_file not in [config_file, config_path_file] and file != "configs":
|
if old_file not in [config_file, config_path_file] and file != "configs":
|
||||||
if not old_file.exists() and new_file.exists():
|
if not old_file.exists() and new_file.exists():
|
||||||
os.rename(new_file.absolute(), old_file.absolute())
|
shutil.move(new_file.absolute(), old_file.absolute())
|
||||||
logger.info(f"已更新文件:{file}")
|
logger.info(f"已更新文件:{file}")
|
||||||
# except Exception as e:
|
# except Exception as e:
|
||||||
# error = f'{type(e)}:{e}'
|
# error = f'{type(e)}:{e}'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user