mirror of
https://github.com/egoist/tsup.git
synced 2025-12-08 20:35:58 +00:00
12 lines
254 B
TypeScript
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
|
|
})
|
|
} |