mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 03:32:33 +08:00
16 lines
672 B
Python
16 lines
672 B
Python
|
|
def update_all():
|
|
"""使用dulwich更新源码"""
|
|
try:
|
|
import dulwich
|
|
except ModuleNotFoundError:
|
|
raise Exception("dulwich模块未安装,请查看 https://github.com/RockChinQ/QChatGPT/issues/77")
|
|
try:
|
|
from dulwich import porcelain
|
|
repo = porcelain.open_repo('.')
|
|
porcelain.pull(repo)
|
|
except ModuleNotFoundError:
|
|
raise Exception("dulwich模块未安装,请查看 https://github.com/RockChinQ/QChatGPT/issues/77")
|
|
except dulwich.porcelain.DivergedBranches:
|
|
raise Exception("分支不一致,自动更新仅支持master分支,请手动更新(https://github.com/RockChinQ/QChatGPT/issues/76)")
|