mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-11 00:06:04 +00:00
feat: 依赖检查移动到main.py
This commit is contained in:
29
main.py
29
main.py
@@ -1,5 +1,5 @@
|
||||
import asyncio
|
||||
|
||||
# QChatGPT 终端启动入口
|
||||
# 在此层级解决依赖项检查。
|
||||
|
||||
asciiart = r"""
|
||||
___ ___ _ _ ___ ___ _____
|
||||
@@ -11,8 +11,29 @@ asciiart = r"""
|
||||
📖文档地址: https://q.rkcn.top
|
||||
"""
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
async def main_entry():
|
||||
print(asciiart)
|
||||
|
||||
import sys
|
||||
|
||||
from pkg.core.bootutils import deps
|
||||
|
||||
missing_deps = await deps.check_deps()
|
||||
|
||||
if missing_deps:
|
||||
print("以下依赖包未安装,将自动安装,请完成后重启程序:")
|
||||
for dep in missing_deps:
|
||||
print("-", dep)
|
||||
await deps.install_deps(missing_deps)
|
||||
print("已自动安装缺失的依赖包,请重启程序。")
|
||||
sys.exit(0)
|
||||
|
||||
from pkg.core import boot
|
||||
asyncio.run(boot.main())
|
||||
await boot.main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import asyncio
|
||||
|
||||
asyncio.run(main_entry())
|
||||
|
||||
Reference in New Issue
Block a user