diff --git a/src/AcTsExtension.ts b/src/AcTsExtension.ts index 1608a96..f049241 100644 --- a/src/AcTsExtension.ts +++ b/src/AcTsExtension.ts @@ -428,10 +428,12 @@ class AcTsExtension { // read output const out = fs.readFileSync(that.tmptestoutfile).toString().trim().replace(/\n/g, "\r\n"); fs.unlinkSync(that.tmptestoutfile); - // read error + if (out) { + that.channel.appendLine(out); + } + // check error const err = fs.readFileSync(that.tmptesterrfile).toString().trim().replace(/\n/g, "\r\n"); fs.unlinkSync(that.tmptesterrfile); - // check error if (err) { that.channel.appendLine(err); reject(`ERROR: error occurred`); diff --git a/template/default_read.ts b/template/default_read.ts index c597e46..05ebefd 100644 --- a/template/default_read.ts +++ b/template/default_read.ts @@ -1,6 +1,6 @@ export { }; // main -async function main() { +(async () => { // util for input const readline = require('readline').createInterface({ input: process.stdin }); const readlineiter = readline[Symbol.asyncIterator](); @@ -177,5 +177,4 @@ async function main() { // answer console.log(ans); return; -} -main(); +})();