Skip to content

Commit

Permalink
fix: 標準出力を必ず表示するよう修正
Browse files Browse the repository at this point in the history
  • Loading branch information
taizod1024 committed Jun 7, 2021
1 parent 00d0539 commit 63ed221
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/AcTsExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
5 changes: 2 additions & 3 deletions template/default_read.ts
Original file line number Diff line number Diff line change
@@ -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]();
Expand Down Expand Up @@ -177,5 +177,4 @@ async function main() {
// answer
console.log(ans);
return;
}
main();
})();

0 comments on commit 63ed221

Please sign in to comment.