Skip to content
This repository has been archived by the owner on Jan 25, 2020. It is now read-only.

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

Open
mex opened this issue Jan 12, 2016 · 2 comments
Open

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

mex opened this issue Jan 12, 2016 · 2 comments
Labels

Comments

@mex
Copy link

mex commented Jan 12, 2016

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:

fs.writeFileSync(file, update.handlers(file, self.framework, route));

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
Copy link
Member

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
Copy link
Author

mex commented Jan 13, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants