mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
perf: 配置文件生成步骤移动到main.py
This commit is contained in:
15
main.py
15
main.py
@@ -17,6 +17,8 @@ async def main_entry():
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# 检查依赖
|
||||||
|
|
||||||
from pkg.core.bootutils import deps
|
from pkg.core.bootutils import deps
|
||||||
|
|
||||||
missing_deps = await deps.check_deps()
|
missing_deps = await deps.check_deps()
|
||||||
@@ -29,6 +31,19 @@ async def main_entry():
|
|||||||
print("已自动安装缺失的依赖包,请重启程序。")
|
print("已自动安装缺失的依赖包,请重启程序。")
|
||||||
sys.exit(0)
|
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
|
from pkg.core import boot
|
||||||
await boot.main()
|
await boot.main()
|
||||||
|
|
||||||
|
|||||||
@@ -21,20 +21,8 @@ from ..plugin import manager as plugin_mgr
|
|||||||
from ..audit.center import v2 as center_v2
|
from ..audit.center import v2 as center_v2
|
||||||
from ..utils import version, proxy, announce
|
from ..utils import version, proxy, announce
|
||||||
|
|
||||||
use_override = False
|
|
||||||
|
|
||||||
|
|
||||||
async def make_app() -> app.Application:
|
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()
|
qcg_logger = await log.init_logging()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user