mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
feat: 未启动状态下的自动更新 (#223)
This commit is contained in:
15
main.py
15
main.py
@@ -343,19 +343,8 @@ if __name__ == '__main__':
|
||||
sys.exit(0)
|
||||
|
||||
elif len(sys.argv) > 1 and sys.argv[1] == 'update':
|
||||
try:
|
||||
try:
|
||||
import pkg.utils.pkgmgr
|
||||
pkg.utils.pkgmgr.ensure_dulwich()
|
||||
except:
|
||||
pass
|
||||
|
||||
from dulwich import porcelain
|
||||
|
||||
repo = porcelain.open_repo('.')
|
||||
porcelain.pull(repo)
|
||||
except ModuleNotFoundError:
|
||||
print("dulwich模块未安装,请查看 https://github.com/RockChinQ/QChatGPT/issues/77")
|
||||
import pkg.utils.updater as updater
|
||||
updater.update_all()
|
||||
sys.exit(0)
|
||||
|
||||
# import pkg.utils.configmgr
|
||||
|
||||
Reference in New Issue
Block a user