Skip to content

Commit af9f72e

Browse files
authored
Fixed issue stderr maxBuffer length exceeded
1 parent 0297c25 commit af9f72e

File tree

1 file changed

+35
-13
lines changed

1 file changed

+35
-13
lines changed

local-cli/desktop/build.js

+35-13
Original file line numberDiff line numberDiff line change
@@ -126,27 +126,49 @@ function _buildApplication(args, desktopExternalModules, desktopJSBundlePath, de
126126
console.log(chalk.bold('Building the app...'));
127127

128128
var buildCommand = process.platform === "win32" ? "build.bat" : "./build.sh";
129+
var buildArguments = [];
130+
129131
if (typeof desktopExternalModules !== 'undefined' && desktopExternalModules !== null) {
130-
buildCommand += ' -e "' + desktopExternalModules.toString().replace(/,/g, ';') + '"';
132+
buildArguments.push("-e");
133+
buildArguments.push(desktopExternalModules.toString().replace(/,/g, ';'));
131134
}
132135
if (typeof desktopJSBundlePath !== 'undefined' && desktopJSBundlePath !== null) {
133-
buildCommand += ' -j "' + desktopJSBundlePath.toString() + '"';
136+
buildArguments.push("-j");
137+
buildArguments.push(desktopJSBundlePath.toString());
134138
}
135139
if (typeof desktopFonts !== 'undefined' && desktopFonts !== null) {
136-
buildCommand += ' -f "' + desktopFonts.toString().replace(/,/g, ';') + '"';
140+
buildArguments.push("-f");
141+
buildArguments.push(desktopFonts.toString().replace(/,/g, ';'));
137142
}
138143
if (process.platform === "win32") {
139-
buildCommand += ' -g "' + "MinGW Makefiles" + '"';
144+
buildArguments.push("-g");
145+
buildArguments.push("MinGW Makefiles");
140146
}
141-
child_process.exec(buildCommand, {cwd: path.join(args.root, 'desktop')},
142-
(error, stdout, stderr) => {
143-
if (error)
144-
reject(error);
145-
else {
146-
console.log(stdout);
147-
resolve();
148-
}
149-
});
147+
var child = child_process.spawn(buildCommand, buildArguments, {cwd: path.join(args.root, 'desktop')});
148+
149+
var stdoutOutput;
150+
var stderrOutput;
151+
child.stdout.on('data', function (data) {
152+
console.log('stdout: ' + data);
153+
stdoutOutput += data;
154+
});
155+
156+
child.stderr.on('data', function (data) {
157+
console.log('stderr: ' + data);
158+
stderrOutput += data;
159+
});
160+
161+
child.on('close', function (code) {
162+
console.log('child process exited with code ' + code);
163+
if (code != 0) {
164+
reject()
165+
}
166+
else {
167+
resolve();
168+
}
169+
});
170+
171+
150172
});
151173
}
152174

0 commit comments

Comments
 (0)