tsup/src/run.ts
2020-05-14 03:15:07 +08:00

12 lines
254 B
TypeScript

import {spawn} from 'child_process'
export function runCode(filename: string, {
args
}: {args: string[]}) {
const cmd = spawn('node', [filename, ...args], {
stdio: 'inherit'
})
cmd.on('exit', code => {
process.exitCode = code || 0
})
}