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) + }) }