yeoman/yeoman — pull request #660 by tomgasson (2012-10-23 08:44:16+00:00)
Title: Usemin Task - Determine linefeed from the content not the platform

This fixes #485 and #649.

usemin.js was using the platform linefeed (\r\n in windows) to join the block lines, then trying to replace this generated block with the new script tag.
`return content.replace(block, indent + '');`

Since it couldn't find the `block joined with '\r\n'` in `file with '\n' for EOL` it would fail silently, without replacing the text.

Instead we should detect the EOL-type from the content.
`var linefeed = /\r\n/g.test(content) ? '\r\n' : '\n';`