@@ -125,21 +125,21 @@ export const requireModule = (modulePath: string, dataDir: string, builtInExtens
125
125
*/
126
126
export const forkModule = ( modulePath : string , args : string [ ] , options : cp . ForkOptions , dataDir ?: string ) : cp . ChildProcess => {
127
127
let proc : cp . ChildProcess ;
128
- const forkArgs = [ "--bootstrap-fork" , modulePath ] ;
129
- if ( args ) {
130
- forkArgs . push ( "--args" , JSON . stringify ( args ) ) ;
131
- }
128
+ const forkOptions : cp . ForkOptions = {
129
+ stdio : [ null , null , null , "ipc" ] ,
130
+ } ;
132
131
if ( options . env ) {
133
132
// This prevents vscode from trying to load original-fs from electron.
134
133
delete options . env . ELECTRON_RUN_AS_NODE ;
135
- forkArgs . push ( "--env" , JSON . stringify ( options . env ) ) ;
134
+ forkOptions . env = options . env ;
135
+ }
136
+ const forkArgs = [ "--bootstrap-fork" , modulePath ] ;
137
+ if ( args ) {
138
+ forkArgs . push ( "--args" , JSON . stringify ( args ) ) ;
136
139
}
137
140
if ( dataDir ) {
138
141
forkArgs . push ( "--data-dir" , dataDir ) ;
139
142
}
140
- const forkOptions : cp . ForkOptions = {
141
- stdio : [ null , null , null , "ipc" ] ,
142
- } ;
143
143
if ( isCli ) {
144
144
proc = cp . spawn ( process . execPath , forkArgs , forkOptions ) ;
145
145
} else {
0 commit comments