jharding/grunt-exec — pull request #31 by qawemlilo (2013-09-30 08:55:47+00:00)
Title: Provide an option to handle the data event

It would be nice if I users can create their own custom functions to handle the data event.
I'm executing a command that checks my php files for syntax error.
I would like to be able parse each output as it comes and checkout if there are no errors, otherwise exit the process.

## Example
```
---
exec: {
test: {
cmd: "find ./component -name '*.php' -exec php -l {} ;",

onOutData: function (data) {
console.log(data);

if (data.match(/Errors parsing|PHP Parse error/g)) {
process.exit(1);
}
},

onErrData: function (data) {
console.log(data);

if (data.match(/Errors parsing|PHP Parse error/g)) {
process.exit(1);
}
}
}
---
```