API compatibility

This commit is contained in:
Thomas 2021-04-23 20:40:49 +12:00 committed by GitHub
parent e409743ca5
commit 5bc607dcec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -85,6 +85,7 @@ class Job {
var stdout = ''; var stdout = '';
var stderr = ''; var stderr = '';
var output = '';
const proc = cp.spawn(proc_call[0], proc_call.splice(1) ,{ const proc = cp.spawn(proc_call[0], proc_call.splice(1) ,{
env: { env: {
@ -108,6 +109,7 @@ class Job {
proc.kill('SIGKILL'); proc.kill('SIGKILL');
} else { } else {
stderr += data; stderr += data;
output += data;
} }
}); });
@ -116,6 +118,7 @@ class Job {
proc.kill('SIGKILL'); proc.kill('SIGKILL');
} else { } else {
stdout += data; stdout += data;
output += data;
} }
}); });
@ -135,13 +138,13 @@ class Job {
proc.on('exit', (code, signal)=>{ proc.on('exit', (code, signal)=>{
exit_cleanup(); exit_cleanup();
resolve({ stdout, stderr, code, signal }); resolve({ stdout, stderr, code, signal, output });
}); });
proc.on('error', (err) => { proc.on('error', (err) => {
exit_cleanup(); exit_cleanup();
reject({ error: err, stdout, stderr }); reject({ error: err, stdout, stderr, output });
}); });
}); });
} }
@ -177,7 +180,9 @@ class Job {
return { return {
compile, compile,
run run,
language: this.runtime.language,
version: this.runtime.version.raw
}; };
} }