feat: 热更新和热重载功能

This commit is contained in:
Rock Chin
2023-01-01 22:52:27 +08:00
parent 887b9e89e8
commit 3b1a72358e
4 changed files with 60 additions and 0 deletions

7
pkg/utils/updater.py Normal file
View File

@@ -0,0 +1,7 @@
def update_all():
try:
from dulwich import porcelain
repo = porcelain.open_repo('.')
porcelain.pull(repo)
except ModuleNotFoundError:
raise Exception("dulwich模块未安装,请查看 https://github.com/RockChinQ/QChatGPT/issues/77")