mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
ensure daemon node has a command to run
in order to prevent crash.
This commit is contained in:
parent
363bb55b26
commit
5ac15e620a
@ -36,6 +36,10 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function runit() {
|
function runit() {
|
||||||
|
if (!node.cmd || (typeof node.cmd !== "string") || (node.cmd.length < 1)) {
|
||||||
|
node.status({fill:"grey",shape:"ring",text:"no command"});
|
||||||
|
return;
|
||||||
|
}
|
||||||
node.child = spawn(node.cmd, node.args);
|
node.child = spawn(node.cmd, node.args);
|
||||||
if (RED.settings.verbose) { node.log(node.cmd+" "+JSON.stringify(node.args)); }
|
if (RED.settings.verbose) { node.log(node.cmd+" "+JSON.stringify(node.args)); }
|
||||||
node.status({fill:"green",shape:"dot",text:"running"});
|
node.status({fill:"green",shape:"dot",text:"running"});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-daemon",
|
"name" : "node-red-node-daemon",
|
||||||
"version" : "0.0.14",
|
"version" : "0.0.15",
|
||||||
"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