feat: 在报错中添加一些信息

This commit is contained in:
msojocs 2022-05-10 20:41:14 +08:00
parent c10036be81
commit 2d2ace5148
2 changed files with 19 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,15 @@ const args = process.argv.slice(2);
const wcscPath = path.resolve(__dirname, "./wcsc.bin");
const DEBUG_OUTPUT = process.env["WX_DEBUG_COMPILER_OUTPUT"];
// 向错误输出流写入信息
process.stderr.write(`环境及执行信息:
编译器版本: ${version}
node版本: ${process.version}
参数: ${args.join(' ')}
具体报错:
`);
function encode1(s) {
return encodeURI(s).replace(
/%(u[0-9A-F]{4})|(%[0-9A-F]{2})/gm,