@node-red/util 4.1.0-beta.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/exec.js +10 -2
  2. package/package.json +1 -1
package/lib/exec.js CHANGED
@@ -57,7 +57,15 @@ module.exports = {
57
57
  return new Promise((resolve, reject) => {
58
58
  let stdout = "";
59
59
  let stderr = "";
60
- const child = child_process.spawn(command,args,options);
60
+ let child
61
+ if (args && options.shell) {
62
+ // If we are using a shell, we need to join the args into a single string
63
+ // as passing a separate array of args is deprecated in Node 24
64
+ command = [command].concat(args).join(" ");
65
+ child = child_process.spawn(command, options)
66
+ } else {
67
+ child = child_process.spawn(command, args, options);
68
+ }
61
69
  child.stdout.on('data', (data) => {
62
70
  const str = ""+data;
63
71
  stdout += str;
@@ -78,7 +86,7 @@ module.exports = {
78
86
  stdout: stdout,
79
87
  stderr: stderr
80
88
  }
81
- emit && events.emit("event-log", {id:invocationId,payload:{ts: Date.now(),data:"rc="+code}});
89
+ emit && events.emit("event-log", {id:invocationId,payload:{ts: Date.now(), data:"rc="+code, end: true}});
82
90
 
83
91
  if (code === 0) {
84
92
  resolve(result)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-red/util",
3
- "version": "4.1.0-beta.1",
3
+ "version": "4.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",