diff --git a/pkg/utils/updater.py b/pkg/utils/updater.py index 4813ea30..84aa836a 100644 --- a/pkg/utils/updater.py +++ b/pkg/utils/updater.py @@ -152,24 +152,12 @@ def get_remote_url(repo_path: str) -> str: def get_current_version_info() -> str: """获取当前版本信息""" - check_dulwich_closure() - - from dulwich import porcelain - - repo = porcelain.open_repo('.') - - 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 + rls_list = get_release_list() + current_tag = get_current_tag() + for rls in rls_list: + if rls['tag_name'] == current_tag: + return rls['name'] + "\n" + rls['body'] + return "未知版本" def get_commit_id_and_time_and_msg() -> str: