From e17c1087e91dc7172656629f507ccd17cfaece84 Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Thu, 8 Jun 2023 13:57:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(updater.py):=20=E6=9B=B4=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E5=BF=BD=E7=95=A5=E4=B8=BB=E7=89=88=E6=9C=AC=E5=8F=B7=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E7=9A=84=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/utils/updater.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/utils/updater.py b/pkg/utils/updater.py index 909adeb6..9a661e72 100644 --- a/pkg/utils/updater.py +++ b/pkg/utils/updater.py @@ -34,13 +34,18 @@ def pull_latest(repo_path: str) -> bool: return True -def is_newer_ignored_bugfix_ver(new_tag: str, old_tag: str): - """判断版本是否更新,忽略第四位版本""" +def is_newer(new_tag: str, old_tag: str): + """判断版本是否更新,忽略第四位版本和第一位版本""" if new_tag == old_tag: return False new_tag = new_tag.split(".") old_tag = old_tag.split(".") + + # 判断主版本是否相同 + if new_tag[0] != old_tag[0]: + return False + if len(new_tag) < 4: return True @@ -97,7 +102,7 @@ def update_all(cli: bool = False) -> bool: else: print("更新日志: {}".format(rls_notes)) - if latest_rls == {} and not is_newer_ignored_bugfix_ver(latest_tag_name, current_tag): # 没有新版本 + if latest_rls == {} and not is_newer(latest_tag_name, current_tag): # 没有新版本 return False # 下载最新版本的zip到temp目录 @@ -254,7 +259,7 @@ def is_new_version_available() -> bool: latest_tag_name = rls['tag_name'] break - return is_newer_ignored_bugfix_ver(latest_tag_name, current_tag) + return is_newer(latest_tag_name, current_tag) def get_rls_notes() -> list: