cowboy/grunt — Issue #66: Improve error handling for child_process helper
Author: jzaefferer
Created: 2012-03-09 16:23:19+00:00
State: open

When a child process outputs an error to stdout, the output is lost. The error argument provides only the exist code, which is not useful.

Encountered the issue with a zip spawn:

task.helper("child_process", {
cmd: "zip",
args: ["-r", data.dest, src],
opts: {
cwd: 'dist'
}
}, function(err, result) {
if (err) {
log.error(err);
done();
return;
}
log.writeln("Zipped " + data.dest);
done();
});

Use anything non-existent for the src argument and you should get a "12" back, while on stdout it would actually output something like "zip warning: name not matched: [...]"