Skip to content

Commit

Permalink
Simplify and correct newlines replacement logic on Windows (#1713)
Browse files Browse the repository at this point in the history
  • Loading branch information
kvakulo authored and albinekb committed Apr 5, 2017
1 parent 7a64c9e commit ec18537
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function exec(str) {
// to text formatted with DOS line endings. We do this because the default
// text editor on Windows (notepad) doesn't Deal with LF files. Still. In 2017.
function crlfify(str) {
return str.split('\n').map(x => x.indexOf('\r') < 0 ? x : `${x}\r`).join('\n');
return str.replace(/\r?\n/g, '\r\n');
}

exports.subscribe = function (fn) {
Expand Down

0 comments on commit ec18537

Please sign in to comment.