mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-26 03:44:58 +08:00
fix: 错误的!version指令处理逻辑
This commit is contained in:
@@ -152,24 +152,12 @@ def get_remote_url(repo_path: str) -> str:
|
|||||||
|
|
||||||
def get_current_version_info() -> str:
|
def get_current_version_info() -> str:
|
||||||
"""获取当前版本信息"""
|
"""获取当前版本信息"""
|
||||||
check_dulwich_closure()
|
rls_list = get_release_list()
|
||||||
|
current_tag = get_current_tag()
|
||||||
from dulwich import porcelain
|
for rls in rls_list:
|
||||||
|
if rls['tag_name'] == current_tag:
|
||||||
repo = porcelain.open_repo('.')
|
return rls['name'] + "\n" + rls['body']
|
||||||
|
return "未知版本"
|
||||||
version_str = ""
|
|
||||||
|
|
||||||
for entry in repo.get_walker():
|
|
||||||
version_str += "提交编号: "+str(entry.commit.id)[2:9] + "\n"
|
|
||||||
tz = datetime.timezone(datetime.timedelta(hours=entry.commit.commit_timezone // 3600))
|
|
||||||
dt = datetime.datetime.fromtimestamp(entry.commit.commit_time, tz)
|
|
||||||
version_str += "时间: "+dt.strftime('%m-%d %H:%M:%S') + "\n"
|
|
||||||
version_str += "说明: "+str(entry.commit.message, encoding="utf-8").strip() + "\n"
|
|
||||||
version_str += "提交作者: '" + str(entry.commit.author)[2:-1] + "'"
|
|
||||||
break
|
|
||||||
|
|
||||||
return version_str
|
|
||||||
|
|
||||||
|
|
||||||
def get_commit_id_and_time_and_msg() -> str:
|
def get_commit_id_and_time_and_msg() -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user