mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
parent
c3a5716fe7
commit
074ca44b5f
@ -50,9 +50,9 @@ module.exports = function(RED) {
|
|||||||
if (node.cr === true) { msg.payload += "\n"; }
|
if (node.cr === true) { msg.payload += "\n"; }
|
||||||
}
|
}
|
||||||
node.debug("inp: "+msg.payload);
|
node.debug("inp: "+msg.payload);
|
||||||
|
lastmsg = msg;
|
||||||
if (node.child !== null && node.running) { node.child.stdin.write(msg.payload); }
|
if (node.child !== null && node.running) { node.child.stdin.write(msg.payload); }
|
||||||
else { node.warn(RED._("daemon.errors.notrunning")); }
|
else { node.warn(RED._("daemon.errors.notrunning")); }
|
||||||
lastmsg = msg;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
let args = node.args;
|
let args = node.args;
|
||||||
if (appendArgs !== undefined && appendArgs.length > 0) {
|
if (appendArgs !== undefined && appendArgs.length > 0) {
|
||||||
args = args.concat(appendArgs);
|
args = args.concat(appendArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -120,6 +120,12 @@ module.exports = function(RED) {
|
|||||||
else { node.log('error: ' + err); }
|
else { node.log('error: ' + err); }
|
||||||
node.status({fill:"red",shape:"ring",text:RED._("daemon.status.error")});
|
node.status({fill:"red",shape:"ring",text:RED._("daemon.status.error")});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
node.child.stdin.on('error', function (err) {
|
||||||
|
if (err.errno === "EPIPE") { node.error(RED._("daemon.errors.pipeclosed"),lastmsg); }
|
||||||
|
else { node.log('error: ' + err); }
|
||||||
|
node.status({fill:"red",shape:"ring",text:RED._("daemon.status.error")});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
if (e.errno === "ENOENT") { node.warn(RED._("daemon.errors.notfound")); }
|
if (e.errno === "ENOENT") { node.warn(RED._("daemon.errors.notfound")); }
|
||||||
|
@ -37,7 +37,8 @@
|
|||||||
"notrunning": "Command not running",
|
"notrunning": "Command not running",
|
||||||
"notfound": "Command not found",
|
"notfound": "Command not found",
|
||||||
"notexecutable": "Command not executable",
|
"notexecutable": "Command not executable",
|
||||||
"restarting": "Restarting"
|
"restarting": "Restarting",
|
||||||
|
"pipeclosed": "Process closed"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-daemon",
|
"name" : "node-red-node-daemon",
|
||||||
"version" : "0.5.0",
|
"version" : "0.5.1",
|
||||||
"description" : "A Node-RED node that runs and monitors a long running system command.",
|
"description" : "A Node-RED node that runs and monitors a long running system command.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user