summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprzemyslawpluta <przemekpluta@hotmail.com>2014-06-01 12:36:10 +0100
committerprzemyslawpluta <przemekpluta@hotmail.com>2014-06-01 12:36:10 +0100
commitca665af8138a330ccf9ef0175679266d039538e9 (patch)
treea084971def6b2b6eff6dc61b41774dafb8640f95
parentd54848bf9f5e11ce6c88906c74b494d61d9eca3a (diff)
downloadmongo-edu-ca665af8138a330ccf9ef0175679266d039538e9.zip
normalize paths win/os
-rw-r--r--mongo-edu.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/mongo-edu.js b/mongo-edu.js
index 64c3301..68ff39d 100644
--- a/mongo-edu.js
+++ b/mongo-edu.js
@@ -9,6 +9,7 @@
var mdbvideos = require('./lib/login'),
videoHandler = require('./lib/videos'),
validate = require('./lib/validate'),
+ path = require('path'),
colors = require('colors'),
inquirer = require('inquirer'),
optimist = require('optimist')
@@ -27,10 +28,14 @@ exports.create = function start() {
'use strict';
- var argv = optimist.argv, lookFor = ((!argv.h)? 'Videos' : 'Handouts');
+ var argv = optimist.argv, lookFor = ((!argv.h)? 'Videos' : 'Handouts'), isWin = /^win/.test(process.platform), slash = (isWin) ? '\\' : '/';
if (argv.help) { return optimist.showHelp(); }
+ argv.d = path.normalize(argv.d);
+
+ if (argv.d.substr(-1) !== slash) { argv.d += slash; }
+
validate.init(argv, function (err, profile) {
if (err !== null) { throw err; }
run(profile);