2017-03-03 19:52:23 +00:00
|
|
|
import * as spawnWrap from 'spawn-wrap'
|
|
|
|
|
|
|
|
let unwrap: any = null
|
|
|
|
|
2017-03-03 20:32:40 +00:00
|
|
|
export let startSpawnWrap = (filePath: string, cliArgs: string[] = [], envArgs: any = {}) => {
|
2017-03-03 19:52:23 +00:00
|
|
|
let spawnArray = [filePath]
|
|
|
|
for (let cliArg of cliArgs) {
|
|
|
|
spawnArray.push(cliArg)
|
|
|
|
}
|
|
|
|
unwrap = spawnWrap(spawnArray, envArgs)
|
|
|
|
}
|
|
|
|
|
|
|
|
export let endSpawnWrap = () => {
|
|
|
|
if (unwrap) {
|
|
|
|
unwrap()
|
|
|
|
unwrap = null
|
|
|
|
}
|
|
|
|
}
|