From 6f2eed0dc2dc4c6208f07d4af07ac5b288a97aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 2 Oct 2026 22:29:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E6=A0=A1=E9=AA=8C=E6=97=A0=E6=B3=95=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=20cargo/npx=20=E6=97=B6=E6=9A=B4=E9=9C=B2=E7=9C=9F?= =?UTF-8?q?=E5=AE=9E=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - spawnSync 连命令都拉不起来(如 ENOENT)时 status 为 null、error 非空,原来只报一句"未通过",看不到原因 - run() 改为在 result.error 时先打印"无法启动 <命令>:<原因>",spawn 失败与测试失败可区分 --- scripts/check-generated-bindings.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/check-generated-bindings.mjs b/scripts/check-generated-bindings.mjs index 02bc1675e..be3e28878 100644 --- a/scripts/check-generated-bindings.mjs +++ b/scripts/check-generated-bindings.mjs @@ -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) {