grunt-newer icon indicating copy to clipboard operation
grunt-newer copied to clipboard

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

Open guncha opened this issue 9 years ago • 4 comments

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.

guncha avatar May 29 '15 23:05 guncha

Can you provide an example that demonstrates a problem.

tschaub avatar May 30 '15 03:05 tschaub

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

guncha avatar May 30 '15 15:05 guncha

@tschaub, did you manage to confirm it?

guncha avatar Jun 05 '15 14:06 guncha

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.

terite avatar Aug 14 '15 01:08 terite