nzakas / cssembed

A tool for embedding data URIs in CSS files.
http://www.nczonline.net/
389 stars 30 forks source link

Don't create invalid files #21

Closed tivac closed 13 years ago

tivac commented 13 years ago

CSSEmbed should delay creating the new file until after it has successfully completed, as currently if there is an error while parsing the file it will create an empty file.

Cleaning up the file after an error is thrown won't quite work either, as I'm naming the output file the same as the input. That behavior would leave me with no file at all, when IMO it should leave the original file unharmed.