Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
In writeJSON (grunt), use CRLF on Windows (#13458)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Gerber authored and ficristo committed Jun 18, 2017
1 parent 9b7a4ee commit 731177d
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, " "));
}

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 731177d

Please sign in to comment.