From c1e8370916c13351a4073d8e708c2c55a3b6915c Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sun, 4 Oct 2015 19:22:28 +0100 Subject: [PATCH] Lets spawn msg.payload contain comma separated parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (like rest of parameters passed in to spawn via edit dialogue) Will also accept an array… --- nodes/core/core/75-exec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nodes/core/core/75-exec.js b/nodes/core/core/75-exec.js index 8c461e34b..33abf91a0 100644 --- a/nodes/core/core/75-exec.js +++ b/nodes/core/core/75-exec.js @@ -35,9 +35,9 @@ module.exports = function(RED) { // make the extra args into an array // then prepend with the msg.payload if (typeof(msg.payload !== "string")) { msg.payload = (msg.payload || "").toString(); } - var arg = []; - if (node.append.length > 0) { arg = node.append.split(","); } - if ((node.addpay === true) && (msg.payload.toString().trim() !== "")) { arg.unshift(msg.payload); } + var pay = []; + if ((node.addpay === true) && (msg.payload.toString().trim() !== "")) { pay = msg.payload.split(","); } + var arg = pay.concat(node.append.split(",")); if (RED.settings.verbose) { node.log(node.cmd+" ["+arg+"]"); } if (node.cmd.indexOf(" ") == -1) { var ex = spawn(node.cmd,arg);