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
1 changed files with 4 additions and 3 deletions

View File

@ -33,7 +33,10 @@ module.exports = function(RED) {
this.oldrc = (n.oldrc || false).toString();
var node = this;
var cleanup = function(p) {
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"});
//node.error("Exec node 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; }