mirror of
https://github.com/node-red/node-red.git
synced 2025-12-27 07:31:07 +01:00
Handle deprecated calls to child_process with args
This commit is contained in:
@@ -91,7 +91,13 @@ module.exports = function(RED) {
|
||||
const opts = isWindows ? { ...node.spawnOpt, shell: true } : node.spawnOpt
|
||||
/* istanbul ignore else */
|
||||
node.debug(cmd+" ["+arg+"]");
|
||||
child = spawn(cmd,arg,opts);
|
||||
if (opts.shell) {
|
||||
// When called with shell: true, passing in separate args is deprecated in Node 24
|
||||
// so we need to join the command and args into a single string.
|
||||
child = spawn([cmd].concat(arg).join(" "), opts);
|
||||
} else {
|
||||
child = spawn(cmd,arg,opts);
|
||||
}
|
||||
node.status({fill:"blue",shape:"dot",text:"pid:"+child.pid});
|
||||
var unknownCommand = (child.pid === undefined);
|
||||
if (node.timer !== 0) {
|
||||
|
||||
Reference in New Issue
Block a user