mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-06-25 17:54:10 +08:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user