perf: 配置文件生成步骤移动到main.py

This commit is contained in:
RockChinQ 2024-03-02 14:57:55 +08:00
parent 71f2a58acb
commit 92aa9c1711
2 changed files with 15 additions and 12 deletions

15
main.py
View File

@ -17,6 +17,8 @@ async def main_entry():
import sys
# 检查依赖
from pkg.core.bootutils import deps
missing_deps = await deps.check_deps()
@ -29,6 +31,19 @@ async def main_entry():
print("已自动安装缺失的依赖包,请重启程序。")
sys.exit(0)
# 检查配置文件
from pkg.core.bootutils import files
generated_files = await files.generate_files()
if generated_files:
print("以下文件不存在,已自动生成,请按需修改配置文件后重启:")
for file in generated_files:
print("-", file)
sys.exit(0)
from pkg.core import boot
await boot.main()

View File

@ -21,20 +21,8 @@ from ..plugin import manager as plugin_mgr
from ..audit.center import v2 as center_v2
from ..utils import version, proxy, announce
use_override = False
async def make_app() -> app.Application:
global use_override
generated_files = await files.generate_files()
if generated_files:
print("以下文件不存在,已自动生成,请按需修改配置文件后重启:")
for file in generated_files:
print("-", file)
sys.exit(0)
qcg_logger = await log.init_logging()