krakenjs / generator-swaggerize

Yeoman generator for design-driven apis with swagger 2.0 and krakenjs/swaggerize tools.
Other
70 stars 34 forks source link

New line at end of file getting removed on update #59

Open mex opened 8 years ago

mex commented 8 years ago

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. :)

subeeshcbabu-zz commented 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.

mex commented 8 years ago

I can replicate it in a very simple example locally.

I'm running the following:

On Mac OS X 10.11.2.