diff --git a/tasks/lib/common.js b/tasks/lib/common.js index 8a1cede4b50..d7c9ac12387 100644 --- a/tasks/lib/common.js +++ b/tasks/lib/common.js @@ -30,10 +30,6 @@ module.exports = function (grunt) { path = require("path"), _platform; - function writeJSON(grunt, path, obj) { - grunt.file.write(path, JSON.stringify(obj, null, " ") + "\n"); - } - function resolve(relPath) { return path.resolve(process.cwd(), relPath); } @@ -51,6 +47,14 @@ module.exports = function (grunt) { return _platform; } + + function writeJSON(grunt, path, obj) { + var content = JSON.stringify(obj, null, " "); + if (platform() === "win") { + content = content.split("\n").join("\r\n"); + } + grunt.file.write(path, content); + } common.writeJSON = writeJSON; common.resolve = resolve;