
var argv = require('optimist').argv;
var config = require('./config/config.defaults.js');

if (argv['h'])         { config.serverHost        = argv['h']; } 
if (argv['host'])      { config.serverHost        = argv['host']; }

if (argv['p'])         { config.serverPort        = argv['p']; } 
if (argv['port'])      { config.serverPort        = argv['port']; } 

if (argv['d'])         { config.fileServerBaseDir = argv['d']; } 
if (argv['file-dir'])  { config.fileServerBaseDir = argv['file-dir']; } 

if (argv['file-port']) { config.fileServerPort    = argv['file-port']; }


var server = require('./server/server.js');
var debugFileServer = require('./server/debug-file-server.js');

server.run();
debugFileServer.run();

@@ -31,16 +31,40 @@
 ).argv;%0A
+var fs = require('fs');%0A
 var conf
@@ -594,16 +594,237 @@
 t'%5D; %7D%0A%0A
+try %7B%0A    /* Makes sure the path exists and gets rid of any trailing slashes. */%0A    config.fileServerBaseDir = fs.realpathSync(config.fileServerBaseDir);%0A%7D catch (e) %7B%0A    console.log(e.message);%0A    process.exit(1);%0A%7D%0A%0A
 %0Avar ser

Normalize the file dir path. Fixes the problem with UI not working if file dir was specified with a trailing slash.