wilkinsona / project-generator

3 stars 4 forks source link

build.gradle has extra newline #71

Closed mbhave closed 5 years ago

mbhave commented 5 years ago

need to investigate why this test is green even though there are two new lines at the end.

snicoll commented 5 years ago

There aren't two new lines at the end. How can I reproduce this?

Edit: that is interesting. There are two lines on the file system but the thing that reads them only contains one :/ - Even a cat on the file only shows one new line that's crazy!

mbhave commented 5 years ago

I think Files.readAllLines doesn't see the extra line because it's an empty line. It sees the previous one because it has the \n character.

snicoll commented 5 years ago

Good catch. I've been trying different options this afternoon to get that extra line and didn't manage to do so. It looks like we need a new line or EOF signal or something.

snicoll commented 5 years ago

This drives me nuts. I have the same problem on another component that I've refactored. It looks like that if the Writer ends with an empty new line, "something" is adding a carriage return.