fix: 全局修复 openclaw --version 解析(取数字开头词而非 last/pop)

- config.rs get_local_version CLI fallback: split_whitespace().last() → find(数字开头)
- dev-api.js getLocalOpenclawVersion: split().pop() → find(/^\d/)
- 同一个 bug 导致版本号被解析为 commit hash,影响版本比较和微信插件兼容检测
This commit is contained in:
晴天
2026-03-26 05:31:17 +08:00
parent 6df7f49190
commit f3d7a478ae
2 changed files with 3 additions and 3 deletions

View File

@@ -515,7 +515,7 @@ function getLocalOpenclawVersion() {
} catch {}
}
if (!current) {
try { current = execSync('openclaw --version 2>&1', { windowsHide: true }).toString().trim().split(/\s+/).pop() } catch {}
try { current = execSync('openclaw --version 2>&1', { windowsHide: true }).toString().trim().split(/\s+/).find(w => /^\d/.test(w)) || null } catch {}
}
return current || null
}