File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 4
4
Serializable ,
5
5
spawn as nodeSpawn ,
6
6
SpawnOptions ,
7
+ ChildProcess ,
7
8
} from 'child_process'
8
9
import crossSpawn from 'cross-spawn'
9
10
import { onExit } from 'signal-exit'
@@ -38,8 +39,8 @@ export type Cleanup = (
38
39
code : number | null ,
39
40
signal : null | NodeJS . Signals ,
40
41
processInfo : {
41
- watchdog : ChildProcess
42
- }
42
+ watchdogPid : ChildProcess [ 'pid' ]
43
+ } ,
43
44
) =>
44
45
| void
45
46
| undefined
@@ -162,7 +163,7 @@ export function foregroundChild(
162
163
const removeOnExit = onExit ( childHangup )
163
164
164
165
proxySignals ( child )
165
- watchdog ( child )
166
+ const dog = watchdog ( child )
166
167
167
168
let done = false
168
169
child . on ( 'close' , async ( code , signal ) => {
@@ -171,7 +172,7 @@ export function foregroundChild(
171
172
/* c8 ignore stop */
172
173
done = true
173
174
const result = cleanup ( code , signal , {
174
- watchdog : dog ,
175
+ watchdogPid : dog . pid ,
175
176
} )
176
177
const res = isPromise ( result ) ? await result : result
177
178
removeOnExit ( )
You can’t perform that action at this time.
0 commit comments