From d77b03c1882dc89dab64fd74e19d82eaf427794d Mon Sep 17 00:00:00 2001 From: cfdaily Date: Fri, 22 May 2026 18:27:08 +0800 Subject: [PATCH] auto-sync: 2026-05-22 18:27:08 --- scripts/status.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/status.sh b/scripts/status.sh index 69fc516..4c5d394 100755 --- a/scripts/status.sh +++ b/scripts/status.sh @@ -30,7 +30,15 @@ echo " moziplus v2 — Status" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" # ── 版本 ── -VERSION=$(cd "$TARGET_DIR" 2>/dev/null && python3 -c 'import tomllib; print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"])' 2>/dev/null || echo 'unknown') +VERSION=$(cd "$TARGET_DIR" 2>/dev/null && python3 -c ' +try: + import tomllib; print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"]) +except ImportError: + try: + import tomli as tomllib; print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"]) + except ImportError: + import re; m=re.search(r"version\s*=\s*[\"']([^\"']+)[\"']", open("pyproject.toml").read()); print(m.group(1) if m else "unknown") +' 2>/dev/null || echo 'unknown') echo " Version: v$VERSION" # ── 安装目录 ──