@@ -16,6 +16,7 @@ var restart = null;
16
16
var psTree = require ( 'pstree.remy' ) ;
17
17
var path = require ( 'path' ) ;
18
18
var signals = require ( './signals' ) ;
19
+ const undefsafe = require ( 'undefsafe' ) ;
19
20
const osRelease = parseInt ( require ( 'os' ) . release ( ) . split ( '.' ) [ 0 ] , 10 ) ;
20
21
21
22
function run ( options ) {
@@ -64,7 +65,10 @@ function run(options) {
64
65
65
66
const spawnOptions = {
66
67
env : Object . assign ( { } , process . env , options . execOptions . env , {
67
- PATH : binPath + path . delimiter + options . execOptions . env ?. PATH || process . env . PATH ,
68
+ PATH :
69
+ binPath +
70
+ path . delimiter +
71
+ ( undefsafe ( options , '.execOptions.env.PATH' ) || process . env . PATH ) ,
68
72
} ) ,
69
73
stdio : stdio ,
70
74
} ;
@@ -129,7 +133,7 @@ function run(options) {
129
133
silent : ! hasStdio ,
130
134
} ;
131
135
if ( utils . isWindows ) {
132
- forkOptions . windowsHide = true ;
136
+ forkOptions . windowsHide = true ;
133
137
}
134
138
child = fork ( options . execOptions . script , forkArgs , forkOptions ) ;
135
139
utils . log . detail ( 'forking' ) ;
@@ -341,7 +345,12 @@ function kill(child, signal, callback) {
341
345
// We are handling a 'SIGKILL' , 'SIGUSR2' and 'SIGUSR1' POSIX signal under Windows the
342
346
// same way it is handled on a UNIX system: We are performing
343
347
// a hard shutdown without waiting for the process to clean-up.
344
- if ( signal === 'SIGKILL' || osRelease < 10 || signal === 'SIGUSR2' || signal === "SIGUSR1" ) {
348
+ if (
349
+ signal === 'SIGKILL' ||
350
+ osRelease < 10 ||
351
+ signal === 'SIGUSR2' ||
352
+ signal === 'SIGUSR1'
353
+ ) {
345
354
debug ( 'terminating process group by force: %s' , child . pid ) ;
346
355
347
356
// We are using the taskkill utility to terminate the whole
0 commit comments