Merge branch 'master' into i18n-de/help

This commit is contained in:
Dave Conway-Jones
2021-03-12 13:16:46 +00:00
committed by GitHub
15 changed files with 208 additions and 47 deletions

View File

@@ -7,7 +7,7 @@ module.exports = function(RED) {
RED.nodes.createNode(this,n);
this.cmd = n.command;
//this.args = n.args.trim().split(" ") || [];
this.args = n.args.trim().match(/("[^"]*")|[^ ]+/g);
this.args = n.args.trim(); //.match(/("[^"]*")|[^ ]+/g);
this.cr = n.cr;
this.op = n.op;
this.redo = n.redo;
@@ -15,6 +15,13 @@ module.exports = function(RED) {
this.closer = n.closer || "SIGKILL";
this.autorun = true;
if (n.autorun === false) { this.autorun = false; }
if (this.args.match(/^\[.*\]$/)) {
try { this.args = JSON.parse(this.args); }
catch(e) {
node.warn("Bad parameters - should be a JSON array or space separated")
}
}
else { this.args = this.args.match(/("[^"]*")|[^ ]+/g); }
var node = this;
var lastmsg = {};
@@ -63,7 +70,6 @@ module.exports = function(RED) {
while (bits.length > 1) {
var m = RED.util.cloneMessage(lastmsg);
m.payload = bits.shift();
console.log(m);
node.send([m,null,null]);
}
line = bits[0];

View File

@@ -1,6 +1,6 @@
{
"name" : "node-red-node-daemon",
"version" : "0.1.3",
"version" : "0.2.0",
"description" : "A Node-RED node that runs and monitors a long running system command.",
"dependencies" : {
},