diff options
author | przemyslawpluta <przemekpluta@hotmail.com> | 2014-04-26 19:59:29 +0100 |
---|---|---|
committer | przemyslawpluta <przemekpluta@hotmail.com> | 2014-04-26 19:59:29 +0100 |
commit | 0de5bfb1b3f2726b84da8b9f3646a71e83cf9939 (patch) | |
tree | e3cad175b6f21094f2ab822b95241ef929263194 /lib | |
parent | 66fb1a09e6abbeda2c673d8d71e5e196a91c2cc7 (diff) | |
download | mongo-edu-0de5bfb1b3f2726b84da8b9f3646a71e83cf9939.zip |
win typo fix
Diffstat (limited to 'lib')
-rw-r--r-- | lib/courseware.js | 5 |
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); } }); } |