From 3a9aa8b7604f5e03479fe17b6da9c28fb77c295a Mon Sep 17 00:00:00 2001 From: root <1561515308@qq.com> Date: Sat, 30 Mar 2024 10:29:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pmpt/util.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pmpt/util.py b/pmpt/util.py index edf353f..27ba6cb 100644 --- a/pmpt/util.py +++ b/pmpt/util.py @@ -8,10 +8,12 @@ from platformdirs import PlatformDirs dirs = PlatformDirs("PMPT", "MoYan") IndexList = [] -def getVer(baseVar): - baseVar = baseVar + '.' + str(int(time.time()))[:6] +def getVer(): + s = os.popen('git describe --tags').read() + baseVar = s.split('v')[1] + '_' + os.environ.get('GITHUB_RUN_ID', str(int(time.time()))[:6]) return baseVar -__version__ = getVer('1.0.0') + +__version__ = getVer() def init(): os.makedirs(dirs.user_data_dir,exist_ok=True) os.makedirs(os.path.join(dirs.user_data_dir,'Index'),exist_ok=True)