mrm-core icon indicating copy to clipboard operation
mrm-core copied to clipboard

`copyFiles` remove EOF

Open alexander-akait opened this issue 7 years ago • 3 comments

I think problem here https://github.com/sapegin/mrm-core/blob/f21ca5be125aef3f49cef126a41a4e62845c83bb/src/fs.js#L11

alexander-akait avatar Dec 21 '18 10:12 alexander-akait

Yeah, I guess we should do trim() here:

https://github.com/sapegin/mrm-core/blob/f21ca5be125aef3f49cef126a41a4e62845c83bb/src/fs.js#L46

Feel free to send a pull request! ;-)

sapegin avatar Dec 21 '18 14:12 sapegin

Honestly, I'm not at all sure what we should do. Because i can put many newlines before/after files and do this specially. I can add trim(), but i think we should have discussion about this

alexander-akait avatar Apr 29 '19 10:04 alexander-akait

The idea is to avoid unnecessary changes. When a file is changes just because a template had a new line at the end, it's an unnecessary change. That's why we should ignore leading/trailing new lines when we do comparison.

sapegin avatar Apr 29 '19 14:04 sapegin