mirror of
https://github.com/node-red/node-red.git
synced 2025-12-27 15:34:26 +01:00
Handle deprecated calls to child_process with args
This commit is contained in:
10
packages/node_modules/@node-red/util/lib/exec.js
vendored
10
packages/node_modules/@node-red/util/lib/exec.js
vendored
@@ -57,7 +57,15 @@ module.exports = {
|
||||
return new Promise((resolve, reject) => {
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
const child = child_process.spawn(command,args,options);
|
||||
let child
|
||||
if (args && options.shell) {
|
||||
// If we are using a shell, we need to join the args into a single string
|
||||
// as passing a separate array of args is deprecated in Node 24
|
||||
command = [command].concat(args).join(" ");
|
||||
child = child_process.spawn(command, options)
|
||||
} else {
|
||||
child = child_process.spawn(command, args, options);
|
||||
}
|
||||
child.stdout.on('data', (data) => {
|
||||
const str = ""+data;
|
||||
stdout += str;
|
||||
|
||||
Reference in New Issue
Block a user