diff --git a/ChangeLog b/ChangeLog index 028ee029..a3eaada1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -129,6 +129,8 @@ config.json only if it setted up. * Fixed bug with starting node from other then projects dir. +* Fixed bug with slashes on win32. + 2012.10.01, Version 0.1.7 diff --git a/cloudcmd.js b/cloudcmd.js index 4d780500..7f45152d 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -16,7 +16,11 @@ Server = main.require(DIR + 'server'), srv = Server.CloudServer, Config = main.config; - + + /* reinit main dir os if we on + * Win32 should be backslashes */ + DIR = main.DIR; + readConfig(); Server.start(Config, { index : indexProcessing, diff --git a/lib/server/main.js b/lib/server/main.js index dec323a9..837ff263 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -5,7 +5,8 @@ LIBDIR, SRVDIR, Util, - + SLASH, + ISWIN32 = process.platform == 'win32', OK = 200, ERROR = 404, Extensions = { @@ -24,9 +25,10 @@ /* Constants */ /* current dir + 2 levels up */ - exports.DIR = DIR = __dirname + '/../../', - exports.LIBDIR = LIBDIR = DIR + 'lib/', - exports.SRVDIR = SRVDIR = LIBDIR + 'server/', + exports.SLASH = SLASH = ISWIN32 ? '\\' : '/', + exports.SRVDIR = SRVDIR = __dirname + SLASH, + exports.LIBDIR = LIBDIR = SRVDIR + '..' + SLASH, + exports.DIR = DIR = LIBDIR + '..' + SLASH, exports.WIN32 = isWin32(); /* Functions */