From 1063a3d036a22434c76693ea37a32d1c90cae251 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Thu, 16 Feb 2012 14:15:24 -0800 Subject: [PATCH] Account for more spaces and Windows paths. This fixes #456. --- node/utils/common_code.js | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/node/utils/common_code.js b/node/utils/common_code.js index 359c9cfec..645a74ba3 100644 --- a/node/utils/common_code.js +++ b/node/utils/common_code.js @@ -15,8 +15,10 @@ */ var RequireKernel = require('require-kernel/'); +var path = require('path'); -var CLIENT_JS_SRC = __dirname + '/../../static/js/'; -var client_require = RequireKernel.requireForPaths('file://' + CLIENT_JS_SRC); +var CLIENT_JS_SRC = path.normalize(__dirname + '/../../static/js/'); +var client_require = RequireKernel.requireForPaths( + 'file://' + (CLIENT_JS_SRC.charAt(0) == '/' ? '' : '/') + encodeURI(CLIENT_JS_SRC)); exports.require = client_require; diff --git a/package.json b/package.json index c05a909a2..27b2125a1 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "name": "Robin Buse" } ], "dependencies" : { - "require-kernel" : "1.0.2", + "require-kernel" : "1.0.3", "socket.io" : "0.8.7", "ueberDB" : "0.1.7", "async" : "0.1.15",