Skip to content

Commit

Permalink
fix: set exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed May 13, 2020
1 parent 61adc9a commit 60542f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import {spawn} from 'child_process'
export function runCode(filename: string, {
args
}: {args: string[]}) {
spawn('node', [filename, ...args], {
const cmd = spawn('node', [filename, ...args], {
stdio: 'inherit'
})
cmd.on('exit', code => {
process.exitCode = code || 0
})
}

0 comments on commit 60542f7

Please sign in to comment.