File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ module.exports = function(opts) {
88 delete process . env [ id ] ;
99 } else {
1010 // In the parent, set the tracking environment variable, fork the child and exit
11- opts = Object . assign ( { } , {
11+ opts = opts || { } ;
12+ const o = Object . assign ( {
1213 // spawn options
13- env : process . env ,
14+ env : Object . assign ( process . env , opts . env , { [ id ] : "1" } ) ,
1415 cwd : process . cwd ( ) ,
1516 stdio : "ignore" ,
1617 detached : true ,
@@ -20,8 +21,7 @@ module.exports = function(opts) {
2021 arguments : process . argv . slice ( 2 ) ,
2122 exitCode : 0 ,
2223 } , opts ) ;
23- opts . env = Object . assign ( { } , opts . env , { [ id ] : "1" } ) ;
24- require ( "child_process" ) . spawn ( opts . node , [ opts . script ] . concat ( opts . arguments ) , opts ) . unref ( ) ;
25- process . exit ( opts . exitCode ) ;
24+ require ( "child_process" ) . spawn ( o . node , [ o . script ] . concat ( o . arguments ) , o ) . unref ( ) ;
25+ process . exit ( o . exitCode ) ;
2626 }
2727} ;
You can’t perform that action at this time.
0 commit comments