From 4f8384e14168adf193f3f3a1fcf3391256dc66f0 Mon Sep 17 00:00:00 2001 From: msojocs Date: Tue, 8 Mar 2022 13:41:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=98=8E=E7=A1=AE=20#26?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compiler/nodejs/wcc | 13 +++++++++++-- compiler/nodejs/wcsc | 8 +++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/compiler/nodejs/wcc b/compiler/nodejs/wcc index de086a6..7341ecb 100755 --- a/compiler/nodejs/wcc +++ b/compiler/nodejs/wcc @@ -172,7 +172,10 @@ if (args.includes("-llw")) { return "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0") }) process.stdout.write(result) + }else{ + process.stderr.write(Buffer.concat(errData).toString()); } + process.exit(n) }); } else if (args.includes("-lla")) { @@ -233,12 +236,18 @@ if (args.includes("-llw")) { return "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0") }) process.stdout.write(result) + }else{ + process.stderr.write(Buffer.concat(errData).toString()); } + process.exit(n) }); } else { - spawn(wccPath, args, { + const wcc = spawn(wccPath, args, { cwd: process.cwd(), stdio: "inherit", - }); + }) + wcc.on('close', code=>{ + process.exit(code) + }) } diff --git a/compiler/nodejs/wcsc b/compiler/nodejs/wcsc index 0c7a67f..f1603ef 100755 --- a/compiler/nodejs/wcsc +++ b/compiler/nodejs/wcsc @@ -64,12 +64,18 @@ if (args.includes("-ll")) { return "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0") }) process.stdout.write(result); + }else{ + process.stderr.write(Buffer.concat(errData).toString()); } + process.exit(n) }); } else { - spawn(wcscPath, args, { + const wcsc = spawn(wcscPath, args, { cwd: process.cwd(), stdio: "inherit", }); + wcsc.on('close', code=>{ + process.exit(code) + }) }