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

moved check for shell

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

View File

@ -31,10 +31,10 @@ module.exports = function(RED) {
this.timer = Number(n.timer || 0)*1000; this.timer = Number(n.timer || 0)*1000;
this.activeProcesses = {}; this.activeProcesses = {};
this.oldrc = (n.oldrc || false).toString(); this.oldrc = (n.oldrc || false).toString();
this.execOpt = {encoding:'binary', maxBuffer:10000000};
var node = this; var node = this;
var execOpt = {encoding:'binary', maxBuffer:10000000}; if (process.platform === 'linux' && fs.existsSync('/bin/bash')) { node.execOpt.shell = '/bin/bash'; }
if (process.platform === 'linux' && fs.existsSync('/bin/bash')) { execOpt.shell = '/bin/bash'; }
var cleanup = function(p) { var cleanup = function(p) {
node.activeProcesses[p].kill(); node.activeProcesses[p].kill();
@ -131,7 +131,7 @@ module.exports = function(RED) {
if (node.append.trim() !== "") { cl += " "+node.append; } if (node.append.trim() !== "") { cl += " "+node.append; }
/* istanbul ignore else */ /* istanbul ignore else */
if (RED.settings.verbose) { node.log(cl); } if (RED.settings.verbose) { node.log(cl); }
child = exec(cl, execOpt, function (error, stdout, stderr) { child = exec(cl, node.execOpt, function (error, stdout, stderr) {
var msg2, msg3; var msg2, msg3;
delete msg.payload; delete msg.payload;
if (stderr) { if (stderr) {