summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorprzemyslawpluta <przemekpluta@hotmail.com>2014-04-26 19:59:29 +0100
committerprzemyslawpluta <przemekpluta@hotmail.com>2014-04-26 19:59:29 +0100
commit0de5bfb1b3f2726b84da8b9f3646a71e83cf9939 (patch)
treee3cad175b6f21094f2ab822b95241ef929263194 /lib
parent66fb1a09e6abbeda2c673d8d71e5e196a91c2cc7 (diff)
downloadmongo-edu-0de5bfb1b3f2726b84da8b9f3646a71e83cf9939.zip
win typo fix
Diffstat (limited to 'lib')
-rw-r--r--lib/courseware.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/courseware.js b/lib/courseware.js
index b3faaf4..2431284 100644
--- a/lib/courseware.js
+++ b/lib/courseware.js
@@ -13,7 +13,8 @@ var fs = require('fs'),
colors = require('colors'),
_ = require('lodash');
-var camo = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36' };
+var isWin = /^win/.test(process.platform),
+ camo = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36' };
function saveData(argv, details, data) {
@@ -21,7 +22,7 @@ function saveData(argv, details, data) {
details = details.map(function items(item) { return item.replace(/[^a-z0-9]/gi, '_').replace(/(_){2,}/g, '_'); });
- fs.writeFile(argv.d + details[0] + '-' + details[1] + '.txt', data.join('\n'), function (err) {
+ fs.writeFile(argv.d + details[0] + '-' + details[1] + '.txt', data.join((!isWin) ? '\n' : '\r\n'), function (err) {
if (err !== null) { return console.log(err.stack); }
});
}