Skip to content

Commit 0028e60

Browse files
committed
Replace ‘\n’ with os.EOL (#524)
1 parent f739b98 commit 0028e60

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/cli.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
var fs = require('fs');
1010
var parseArgs = require('minimist');
1111
var path = require('path');
12+
var os = require('os');
1213

1314
var Comb = require('./csscomb');
1415
var Errors = require('./errors');
@@ -86,9 +87,10 @@ function displayHelp() {
8687
' -v, --verbose',
8788
' Whether to print logging info.',
8889
' -t, --tty-mode',
89-
' Run the tool in TTY mode using external app (e.g. IDE).'
90+
' Run the tool in TTY mode using external app (e.g. IDE).',
91+
''
9092
];
91-
process.stdout.write(help.join('\n') + '\n');
93+
process.stdout.write(help.join(os.EOL));
9294
}
9395

9496
function detectConfig() {
@@ -162,7 +164,7 @@ function processFiles(files) {
162164
`${c.length} file${c.length === 1 ? '' : 's'} processed`,
163165
`${changed} file${changed === 1 ? '' : 's'} fixed`,
164166
''
165-
].join('\n');
167+
].join(os.EOL);
166168
process.stdout.write(message);
167169
}
168170

src/core.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
require('babel-polyfill');
55

66
let fs = require('fs');
7+
var os = require('os');
78
let gonzales = require('gonzales-pe');
89
let minimatch = require('minimatch');
910
let Errors = require('./errors');
@@ -145,7 +146,7 @@ class Comb {
145146
result.push(ln + ' | ' + line);
146147
}
147148
}
148-
return result.join('\n');
149+
return result.join(os.EOL);
149150
}
150151

151152
/**
@@ -364,7 +365,7 @@ class Comb {
364365
let message = filename ? [filename] : [];
365366
message.push(e.message);
366367
message.push('CSScomb Core version: ' + version);
367-
e.stack = e.message = message.join('\n');
368+
e.stack = e.message = message.join(os.EOL);
368369
throw e;
369370
}
370371
});

0 commit comments

Comments
 (0)