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

moved building of execOpt object to line 36

This commit is contained in:
johanneskropf 2020-06-12 17:10:31 +02:00 committed by GitHub
parent 06adf3d346
commit d25e027201
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,9 @@ module.exports = function(RED) {
this.oldrc = (n.oldrc || false).toString();
var node = this;
var execOpt = {encoding:'binary', maxBuffer:10000000};
if (process.platform === 'linux' && fs.existsSync('/bin/bash')) { execOpt.shell = '/bin/bash'; }
var cleanup = function(p) {
node.activeProcesses[p].kill();
//node.status({fill:"red",shape:"dot",text:"timeout"});
@ -123,8 +126,6 @@ module.exports = function(RED) {
});
}
else {
var execOpt = {encoding:'binary', maxBuffer:10000000};
if (process.platform === 'linux' && fs.existsSync('/bin/bash')) { execOpt.shell = '/bin/bash'; }
var cl = node.cmd;
if ((node.addpay === true) && msg.hasOwnProperty("payload")) { cl += " "+msg.payload; }
if (node.append.trim() !== "") { cl += " "+node.append; }