1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Exec: Preserve existing properties on msg object

This commit is contained in:
Akash Mugu 2018-10-17 23:20:52 +05:30 committed by Nick O'Leary
parent 45a53ac168
commit 6c01d0f9d8
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -138,14 +138,16 @@ module.exports = function(RED) {
//console.log('[exec] stdout: ' + stdout);
//console.log('[exec] stderr: ' + stderr);
if (error !== null) {
msg3 = {payload:{code:error.code, message:error.message}};
msg3 = RED.util.cloneMessage(msg);
msg3.payload = {code:error.code, message:error.message};
if (error.signal) { msg3.payload.signal = error.signal; }
if (error.code === null) { node.status({fill:"red",shape:"dot",text:"killed"}); }
else { node.status({fill:"red",shape:"dot",text:"error:"+error.code}); }
node.log('error:' + error);
}
else if (node.oldrc === "false") {
msg3 = {payload:{code:0}};
msg3 = RED.util.cloneMessage(msg);
msg3.payload = {code:0};
}
if (!msg3) { node.status({}); }
else {