修复:生成绑定校验无法启动 cargo/npx 时暴露真实原因

- spawnSync 连命令都拉不起来(如 ENOENT)时 status 为 null、error 非空,原来只报一句"未通过",看不到原因
- run() 改为在 result.error 时先打印"无法启动 <命令>:<原因>",spawn 失败与测试失败可区分
This commit is contained in:
2026-10-02 22:29:08 +08:00
parent bfbcb1dd02
commit 6f2eed0dc2
+5 -1
View File
@@ -86,7 +86,11 @@ function snapshot(dir) {
}
function run(command, args) {
return spawnSync(command, args, { cwd: repoRoot, encoding: 'utf8' });
const result = spawnSync(command, args, { cwd: repoRoot, encoding: 'utf8' });
if (result.error) {
console.error(`无法启动 ${command}:${result.error.message}`);
}
return result;
}
function diff(before, after) {