Skip to content

Commit fc9b74c

Browse files
committed
refactor(config): 优化版本信息显示格式
- 将版本信息初始化为空字符串,避免显示"未知" - 在显示插件版本时前面添加空格,保持格式一致性 - 在显示 Phigros 版本时前后添加空格,优化视觉效果
1 parent 829ce58 commit fc9b74c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

phi-plugin/config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
VERSION_PATTERN = re.compile(
1414
r"https://img\.shields\.io/badge/(?P<type>插件版本|Phigros)-(?P<version>(.*))-9cf"
1515
)
16-
currentVersion = "未知"
17-
phigros_ver = "未知"
16+
currentVersion = ""
17+
phigros_ver = ""
1818
with contextlib.suppress(Exception):
1919
if (PATH / "README.md").exists():
2020
with open(PATH / "README.md", encoding="utf-8") as f:
@@ -24,9 +24,9 @@
2424
version = match["version"]
2525

2626
if ver_type == "插件版本":
27-
currentVersion = f"v{version}"
27+
currentVersion = f" v{version}"
2828
elif ver_type == "Phigros":
29-
phigros_ver = version
29+
phigros_ver = f" {version}"
3030

3131
Version: dict[Literal["ver", "phigros", "nonebot"], str] = {
3232
"ver": currentVersion,

0 commit comments

Comments
 (0)