Skip to content

Commit af3b9e2

Browse files
committedJul 7, 2023
fix: node@10 support back in
Can't use .? so we use undefsafe
1 parent a3f0e12 commit af3b9e2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
 

‎lib/monitor/run.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var restart = null;
1616
var psTree = require('pstree.remy');
1717
var path = require('path');
1818
var signals = require('./signals');
19+
const undefsafe = require('undefsafe');
1920
const osRelease = parseInt(require('os').release().split('.')[0], 10);
2021

2122
function run(options) {
@@ -64,7 +65,10 @@ function run(options) {
6465

6566
const spawnOptions = {
6667
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),
6872
}),
6973
stdio: stdio,
7074
};
@@ -129,7 +133,7 @@ function run(options) {
129133
silent: !hasStdio,
130134
};
131135
if (utils.isWindows) {
132-
forkOptions.windowsHide = true;
136+
forkOptions.windowsHide = true;
133137
}
134138
child = fork(options.execOptions.script, forkArgs, forkOptions);
135139
utils.log.detail('forking');
@@ -341,7 +345,12 @@ function kill(child, signal, callback) {
341345
// We are handling a 'SIGKILL' , 'SIGUSR2' and 'SIGUSR1' POSIX signal under Windows the
342346
// same way it is handled on a UNIX system: We are performing
343347
// 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+
) {
345354
debug('terminating process group by force: %s', child.pid);
346355

347356
// We are using the taskkill utility to terminate the whole

0 commit comments

Comments
 (0)
Please sign in to comment.