We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42393ab commit 0907e24Copy full SHA for 0907e24
update_version.py
@@ -2,8 +2,21 @@
2
import re
3
4
def get_version_from_env():
5
+ # 🌟 星野小贴士:这里获取版本号并确保它是有效的数字格式哦 ~
6
original_version = os.getenv('VERSION', 'v1.0.0.0')
7
stripped_version = re.sub(r'^v', '', original_version)
8
+
9
+ # 🔍 白露检查:如果版本号包含非数字字符,提取数字部分
10
+ numeric_version = re.search(r'^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?', stripped_version)
11
+ if numeric_version:
12
+ # 组装有效的X.X.X.X格式版本号
13
+ parts = numeric_version.groups(default='0')
14
+ stripped_version = '.'.join(parts)
15
+ else:
16
+ # 如果无法提取,使用默认版本
17
+ stripped_version = '1.0.0.0'
18
+ original_version = 'v1.0.0.0'
19
20
return original_version, stripped_version
21
22
def update_version_info(version):
0 commit comments