Always convert \r\n and \r sequences to \n on file reading in tool

Fixes https://github.com/meteor/windows-preview/issues/104
This commit is contained in:
Slava Kim
2015-03-20 17:35:55 -07:00
parent d8e22d9404
commit 5dc8ea5ffb

View File

@@ -63,7 +63,9 @@ var convertToOSLineEndings = function (fileContents) {
};
var convertToStandardLineEndings = function (fileContents) {
return fileContents.replace(new RegExp(os.EOL, "g"), "\n");
// Convert all kinds of end-of-line chars to linuxy "\n".
return fileContents.replace(new RegExp("\r\n", "g"), "\n")
.replace(new RegExp("\r", "g"), "\n");
};