From 5dc8ea5ffb59b1561994aade598cdab992e24fe2 Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Fri, 20 Mar 2015 17:35:55 -0700 Subject: [PATCH] Always convert \r\n and \r sequences to \n on file reading in tool Fixes https://github.com/meteor/windows-preview/issues/104 --- tools/server/mini-files.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/server/mini-files.js b/tools/server/mini-files.js index 6c2ad52f11..0249660159 100644 --- a/tools/server/mini-files.js +++ b/tools/server/mini-files.js @@ -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"); };