Skip to content

Commit

Permalink
In writeJSON (grunt), use CRLF on Windows (adobe#13458)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Gerber authored and ficristo committed Nov 26, 2017
1 parent 2fb1fe8 commit 28fec00
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tasks/lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down

0 comments on commit 28fec00

Please sign in to comment.