mirror of
https://github.com/Genshin-bots/gsuid_core.git
synced 2025-05-05 03:23:49 +08:00
🐛 move old config file in docker (#102)
This commit is contained in:
parent
c5922388df
commit
00f17c417b
@ -1,4 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
|
import shutil
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Dict, List, Union, Literal, overload
|
from typing import Any, Dict, List, Union, Literal, overload
|
||||||
|
|
||||||
@ -50,7 +51,9 @@ plugins_sample = {
|
|||||||
class CoreConfig:
|
class CoreConfig:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
if OLD_CONFIG_PATH.exists():
|
if OLD_CONFIG_PATH.exists():
|
||||||
OLD_CONFIG_PATH.rename(CONFIG_PATH)
|
if not CONFIG_PATH.exists():
|
||||||
|
shutil.copy2(OLD_CONFIG_PATH, CONFIG_PATH)
|
||||||
|
OLD_CONFIG_PATH.unlink()
|
||||||
|
|
||||||
if not CONFIG_PATH.exists():
|
if not CONFIG_PATH.exists():
|
||||||
with open(CONFIG_PATH, 'w', encoding='UTF-8') as file:
|
with open(CONFIG_PATH, 'w', encoding='UTF-8') as file:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user