mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add flash of status to exec node
This commit is contained in:
parent
346ca21803
commit
c10ed13322
@ -15,6 +15,7 @@
|
||||
**/
|
||||
|
||||
module.exports = function(RED) {
|
||||
"use strict";
|
||||
var spawn = require('child_process').spawn;
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
@ -27,7 +28,7 @@ module.exports = function(RED) {
|
||||
var node = this;
|
||||
this.on("input", function(msg) {
|
||||
if (msg != null) {
|
||||
|
||||
node.status({fill:"blue",shape:"dot"});
|
||||
if (this.useSpawn == true) {
|
||||
// make the extra args into an array
|
||||
// then prepend with the msg.payload
|
||||
@ -51,6 +52,7 @@ module.exports = function(RED) {
|
||||
ex.on('close', function (code) {
|
||||
//console.log('[exec] result: ' + code);
|
||||
msg.payload = code;
|
||||
node.status({});
|
||||
node.send([null,null,msg]);
|
||||
});
|
||||
}
|
||||
@ -69,6 +71,7 @@ module.exports = function(RED) {
|
||||
var msg3 = {payload:error};
|
||||
//console.log('[exec] error: ' + error);
|
||||
}
|
||||
node.status({});
|
||||
node.send([msg,msg2,msg3]);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user