gruntjs / grunt-init

Generate project scaffolding from a template.
http://gruntjs.com/project-scaffolding
MIT License
193 stars 58 forks source link

Set `grunt.util.linefeed` for `copyAndProcess()` #68

Closed hail2u closed 10 years ago

hail2u commented 10 years ago

copyAndProcess() converts line endings on Windows as mentioned in issue #42. This should be configurable.

grunt.template.process uses grunt.util.normalizelf(), and this function looks grunt.util.linefeed for line endings normalization; therefore setting this property fixes a problem on Windows.

I think Git's core.autocrlf configuration helps to determine whether grunt-init should normalize LF or not. If this configuration is input or true, there is no problem with LF normalization.

grunt-init should set grunt.util.linefeed to \n when core.autocrlf is false for preventing LF normalization.

vladikoff commented 10 years ago

Thanks @hail2u !