remove temp file after running
This commit is contained in:
parent
b85605a340
commit
037dedd162
|
@ -1,4 +1,4 @@
|
||||||
const { writeFileSync } = require('fs');
|
const { writeFileSync, unlinkSync } = require('fs');
|
||||||
const { spawn } = require('child_process');
|
const { spawn } = require('child_process');
|
||||||
|
|
||||||
function execute(language, source, stdin = '', args = []) {
|
function execute(language, source, stdin = '', args = []) {
|
||||||
|
@ -30,6 +30,8 @@ function execute(language, source, stdin = '', args = []) {
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on('exit', code => {
|
process.on('exit', code => {
|
||||||
|
unlinkSync(sourceFile);
|
||||||
|
|
||||||
stderr = stderr.trim().substring(0, 65535);
|
stderr = stderr.trim().substring(0, 65535);
|
||||||
stdout = stdout.trim().substring(0, 65535);
|
stdout = stdout.trim().substring(0, 65535);
|
||||||
output = output.trim().substring(0, 65535);
|
output = output.trim().substring(0, 65535);
|
||||||
|
|
Loading…
Reference in New Issue