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

Commit 731177d

Browse files
Marcel Gerberficristo
authored andcommitted
In writeJSON (grunt), use CRLF on Windows (#13458)
1 parent 9b7a4ee commit 731177d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

tasks/lib/common.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ module.exports = function (grunt) {
3030
path = require("path"),
3131
_platform;
3232

33-
function writeJSON(grunt, path, obj) {
34-
grunt.file.write(path, JSON.stringify(obj, null, " "));
35-
}
36-
3733
function resolve(relPath) {
3834
return path.resolve(process.cwd(), relPath);
3935
}
@@ -51,6 +47,14 @@ module.exports = function (grunt) {
5147

5248
return _platform;
5349
}
50+
51+
function writeJSON(grunt, path, obj) {
52+
var content = JSON.stringify(obj, null, " ");
53+
if (platform() === "win") {
54+
content = content.split("\n").join("\r\n");
55+
}
56+
grunt.file.write(path, content);
57+
}
5458

5559
common.writeJSON = writeJSON;
5660
common.resolve = resolve;

0 commit comments

Comments
 (0)