Skip to content

Commit

Permalink
Fixed issue stderr maxBuffer length exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
vkjr authored Jul 12, 2019
1 parent 0297c25 commit af9f72e
Showing 1 changed file with 35 additions and 13 deletions.
48 changes: 35 additions & 13 deletions local-cli/desktop/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,49 @@ function _buildApplication(args, desktopExternalModules, desktopJSBundlePath, de
console.log(chalk.bold('Building the app...'));

var buildCommand = process.platform === "win32" ? "build.bat" : "./build.sh";
var buildArguments = [];

if (typeof desktopExternalModules !== 'undefined' && desktopExternalModules !== null) {
buildCommand += ' -e "' + desktopExternalModules.toString().replace(/,/g, ';') + '"';
buildArguments.push("-e");
buildArguments.push(desktopExternalModules.toString().replace(/,/g, ';'));
}
if (typeof desktopJSBundlePath !== 'undefined' && desktopJSBundlePath !== null) {
buildCommand += ' -j "' + desktopJSBundlePath.toString() + '"';
buildArguments.push("-j");
buildArguments.push(desktopJSBundlePath.toString());
}
if (typeof desktopFonts !== 'undefined' && desktopFonts !== null) {
buildCommand += ' -f "' + desktopFonts.toString().replace(/,/g, ';') + '"';
buildArguments.push("-f");
buildArguments.push(desktopFonts.toString().replace(/,/g, ';'));
}
if (process.platform === "win32") {
buildCommand += ' -g "' + "MinGW Makefiles" + '"';
buildArguments.push("-g");
buildArguments.push("MinGW Makefiles");
}
child_process.exec(buildCommand, {cwd: path.join(args.root, 'desktop')},
(error, stdout, stderr) => {
if (error)
reject(error);
else {
console.log(stdout);
resolve();
}
});
var child = child_process.spawn(buildCommand, buildArguments, {cwd: path.join(args.root, 'desktop')});

var stdoutOutput;
var stderrOutput;
child.stdout.on('data', function (data) {
console.log('stdout: ' + data);
stdoutOutput += data;
});

child.stderr.on('data', function (data) {
console.log('stderr: ' + data);
stderrOutput += data;
});

child.on('close', function (code) {
console.log('child process exited with code ' + code);
if (code != 0) {
reject()
}
else {
resolve();
}
});


});
}

Expand Down

0 comments on commit af9f72e

Please sign in to comment.