mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-11 00:06:04 +00:00
feat: 支持更新插件
This commit is contained in:
@@ -16,6 +16,18 @@ def check_dulwich_closure():
|
||||
raise Exception("dulwich模块未安装,请查看 https://github.com/RockChinQ/QChatGPT/issues/77")
|
||||
|
||||
|
||||
def pull_latest(repo_path: str) -> bool:
|
||||
"""拉取最新代码"""
|
||||
check_dulwich_closure()
|
||||
|
||||
from dulwich import porcelain
|
||||
|
||||
repo = porcelain.open_repo(repo_path)
|
||||
porcelain.pull(repo)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def update_all() -> bool:
|
||||
"""使用dulwich更新源码"""
|
||||
check_dulwich_closure()
|
||||
@@ -58,7 +70,6 @@ def is_repo(path: str) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
|
||||
def get_remote_url(repo_path: str) -> str:
|
||||
"""获取远程仓库地址"""
|
||||
check_dulwich_closure()
|
||||
|
||||
Reference in New Issue
Block a user