mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Lets spawn msg.payload contain comma separated parameters
(like rest of parameters passed in to spawn via edit dialogue) Will also accept an array…
This commit is contained in:
parent
ddedea8b90
commit
c1e8370916
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user