Open mex opened 8 years ago
Interesting. I was not able to reproduce this using the yo swaggerize --only=handlers
.
@mex - Can you share more details on OS, node version etc. Wondering if this issue, is specific to the environment that the commands are getting executed.
I can replicate it in a very simple example locally.
I'm running the following:
generator-swaggerize
: v2.0.1
node
: v4.2.4
npm
: v3.5.2
On Mac OS X 10.11.2.
It seems like there is a problem with updating handlers (not creating them), where the new line at the end of the file gets removed.
During my local testing I could fix it by simply concatenating the generated code with a new line before writing to file here: https://github.com/krakenjs/generator-swaggerize/blob/3b96665fa81aa7debef792bde1a3be7dd7627110/app/index.js#L259
But this hardly seems like the right way to fix this. I would love to see this fixed (and would be happy to submit a PR, if anyone can come up with a more prudent way of fixing this). I hate seeing the linting errors, due to the missing new line. :)