|
|
@ -35,16 +35,16 @@ module.exports = async (code, lang) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await new Promise((resolve, reject) => { |
|
|
|
await new Promise((resolve, reject) => { |
|
|
|
let exit = code => { |
|
|
|
let exit = () => { |
|
|
|
if (code === 0) resolve(); |
|
|
|
if (process.exitCode === 0) resolve(); |
|
|
|
else reject(code); |
|
|
|
else reject(process.exitCode); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (process.exitCode !== null) exit(process.exitCode); |
|
|
|
if (process.exitCode !== null) exit(); |
|
|
|
else process.on('close', exit); |
|
|
|
else process.on('close', () => exit()); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
console.log(e.stack); |
|
|
|
console.log(e); |
|
|
|
result = null; |
|
|
|
result = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|