node-swig / swig-templates

Take a swig of the best template engine for JavaScript.
http://node-swig.github.io/swig-templates/
MIT License
209 stars 29 forks source link

Check error code instead of errno #15

Closed kevinschaul closed 8 years ago

kevinschaul commented 8 years ago

My machine returns EEXIST as errno -17. Without this patch, the swig executable would fail when attempting to output to a directory that already existed. Checking against the error code EEXIST solves this issue. This technique also feels more readable.

OS X version 10.10.3 node version 5.1.0

cdaringe commented 8 years ago

+1. i agree. ref

Lochlan commented 8 years ago

+1 also. And thanks for adding a test!