wecodemore / grunt-githooks

A Grunt plugin to help bind Grunt tasks to Git hooks
https://npmjs.org/package/grunt-githooks
MIT License
317 stars 24 forks source link

option to log output to screen #43

Closed dorgan closed 8 years ago

dorgan commented 8 years ago

Currently my pre-commit githook runs a grunt task, but I dont see a way to have the output logged to the screen.

franz-josef-kaiser commented 8 years ago

@dorgan have you tried printing to the CLI? It's hard to suggest something with that little information and no code.

dorgan commented 8 years ago

@franz-josef-kaiser printing how?? Not if I run the grunt task on its own, i see the output, but running the grunt task inside the githook, looks like it holds all the output until it completes.

kurdin commented 8 years ago

looks like it holds all the output until it completes

I see the same result and its not very UX friendly specially for large tasks

P.S looks like replacing process.stdout.write(chunk); with console.log(chunk); in https://github.com/wecodemore/grunt-githooks/blob/master/templates/node.js.hb#L15 should fix that problem.

franz-josef-kaiser commented 8 years ago

The templates are just recommendations and should serve as "how to" and are not meant to be used as is. If it's just about that, then please adjust them to your needs. You could write a hook in pretty much every language that your environment offers and we can't add and maintain one "perfect"-does-it-all script in every major language.