@samitouri / QOS-React-2 / commits / 96b0a0253f
Fork 0

The library for web and native user interfaces.

Use grunt.util.spawn for jsx:* tasks instead of exec.

This should prevent "Warning: stdout maxBuffer exceeded" errors. Also piping child process stdout and stderr to the parent process, so you can see more of what's happening during the build process.

Ben Newman committed Jun 17, 2013 at 13:54 UTC 96b0a0253fa4661378d687d71bf7ffb2a082622f
1 file changed +17 -4
grunt/tasks/jsx.js
+17 -4
@@ -1,14 +1,14 @@
1 'use strict';
2
3 -var exec = require("child_process").exec;
4 -var expand = require("grunt").file.expand;
3 +var grunt = require("grunt");
4 +var expand = grunt.file.expand;
5 +var spawn = grunt.util.spawn;
6
7 module.exports = function() {
8 var done = this.async();
9 var config = this.data;
10
11 var args = [
11 - "bin/jsx",
12 "--cache-dir", ".module-cache",
13 "--relativize",
14 config.sourceDir,
@@ -25,5 +25,18 @@ module.exports = function() {
25 args.push.apply(args, rootIDs);
26 args.push("--config", config.configFile);
27
28 - exec(args.join(" "), done);
28 + var child = spawn({
29 + cmd: "bin/jsx",
30 + args: args
31 + }, function(error, result, code) {
32 + if (error) {
33 + grunt.log.error(error);
34 + done(false);
35 + } else {
36 + done();
37 + }
38 + });
39 +
40 + child.stdout.pipe(process.stdout);
41 + child.stderr.pipe(process.stderr);
42 };