Open nielsdrost opened 8 years ago
Ah, you're right. It would be nicer to write to a temporary file, catch any errors, and only move the written file if no errors were raised.
Perhaps create the content as a string? Moving temp files around can also go wrong ;-)
yeah... opening a file to write and then realising you can't write the string also doesn't help though. Our first thought was: people can always revert using git checkout
. But of course if there was no commit in between, that's kinda annoying.
If the generator crashes (especially during the writing of files) it leaves these files in a "broken" state.