tschaub / grunt-newer

Configure Grunt tasks to run with newer files only.
https://npmjs.org/package/grunt-newer
MIT License
944 stars 53 forks source link

If the task fails, newer-postrun:... never gets called #81

Open guncha opened 9 years ago

guncha commented 9 years ago

This was a fun one. On https://github.com/tschaub/grunt-newer/blob/master/tasks/newer.js#L133, when grunt-newer asks for the tasks to be run, if the first task fails for whatever reason, newer-postrun never gets run, the config is not restored and a lot of bad things happen.

For me it manifested as a multi target task stopped working via newer as the config was corrupted. This can be worked around using --force command line option, but I don't know enough about grunt to make the necessary changes.

tschaub commented 9 years ago

Can you provide an example that demonstrates a problem.

guncha commented 9 years ago

Just pushed a repo that demonstrates the problem. Instructions are in the commit message. Hope that helps.

guncha commented 9 years ago

@tschaub, did you manage to confirm it?

terite commented 9 years ago

I'm having this problem frequently in a similar build configuration, and can confirm that https://github.com/tschaub/grunt-newer/pull/80 fixes it.