Skip to content

Commit fd33902

Browse files
committed
added trailing slash to cwd(), fixed missing calipso requires
1 parent ee64b23 commit fd33902

10 files changed

+19
-16
lines changed

app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*/
1010

11-
var rootpath = process.cwd(),
11+
var rootpath = process.cwd() + '/',
1212
path = require('path'),
1313
fs = require('fs'),
1414
express = require('express'),

i18n/translate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var rootpath = process.cwd(),
1+
var rootpath = process.cwd() + '/',
22
path = require('path');
33
/**
44
* Translation function, will be exposed through a connect middleware function

lib/Event.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/**
1616
* Includes
1717
*/
18-
var rootpath = process.cwd(),
18+
var rootpath = process.cwd() + '/',
1919
path = require('path'),
2020
sys = require('sys'),
2121
util = require('util'),
@@ -221,7 +221,7 @@ function ModuleEventEmitter(moduleName) {
221221
*/
222222
function addModuleEventListener(module) {
223223

224-
var calipso = require('lib/calipso');
224+
var calipso = require(path.join(rootpath, 'lib/calipso'));
225225
var moduleEventEmitter = module.event = new ModuleEventEmitter(module.name);
226226

227227
// Link events
@@ -245,7 +245,7 @@ function RequestEventListener() {
245245

246246
// Register a module, listen to its events
247247
var self = this;
248-
var calipso = require('lib/calipso');
248+
var calipso = require(path.join(rootpath, 'lib/calipso'));
249249

250250
// Local hash of module event emitters, used to track routing status
251251
this.modules = {};

lib/Form.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
*/
1919

20-
var rootpath = process.cwd(),
20+
var rootpath = process.cwd() + '/',
2121
path = require('path'),
2222
calipso = require(path.join(rootpath, 'lib/calipso')),
2323
qs = require('qs'),

lib/Link.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*/
1111

12-
var rootpath = process.cwd(),
12+
var rootpath = process.cwd() + '/',
1313
path = require('path'),
1414
calipso = require(path.join(rootpath, 'lib/calipso')),
1515
qs = require('qs');

lib/Menu.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
/**
1313
* Includes
1414
*/
15-
var sys = require('sys'),
16-
utils = require('connect').utils,
17-
merge = utils.merge;
15+
var rootpath = process.cwd(),
16+
path = require('path'),
17+
sys = require('sys'),
18+
utils = require('connect').utils,
19+
merge = utils.merge;
1820

1921
/**
2022
* Exports
@@ -73,7 +75,7 @@ CalipsoMenu.prototype.addMenuItem = function(options) {
7375
var self = this;
7476

7577
// Refresh the reference, as it is initially loaded at startup
76-
calipso = require('lib/calipso');
78+
calipso = require(path.join(rootpath, 'lib/calipso'));
7779

7880
// Split the path, traverse items and add menuItems.
7981
// If you add a child prior to parent, then create the parent.

lib/Router.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
/**
1515
* Includes
1616
*/
17-
var rootpath = process.cwd(),
17+
var rootpath = process.cwd() + '/',
1818
path = require('path'),
1919
calipso = require(path.join(rootpath, 'lib/calipso')),
2020
url = require('url'),
2121
fs = require('fs'),
22-
blocks = require('lib/Blocks');
22+
blocks = require(path.join(rootpath, 'lib/Blocks'));
2323

2424
/**
2525
* Normalize the given path string,

lib/Table.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*/
1313

14-
var rootpath = process.cwd(),
14+
var rootpath = process.cwd() + '/',
1515
path = require('path'),
1616
calipso = require(path.join(rootpath, 'lib/calipso')),
1717
qs = require('qs'),

lib/Theme.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
/**
2424
* Includes
2525
*/
26-
var rootpath = process.cwd(),
26+
27+
var rootpath = process.cwd() + '/',
2728
path = require('path'),
2829
calipso = require(path.join(rootpath, 'lib/calipso')),
2930
fs = require('fs'),

lib/calipso.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ function checkRouted(req,res,moduleName,notifyModuleName) {
806806
function requireModule(module, modulePath, reload) {
807807

808808
var fs = calipso.lib.fs;
809-
var moduleFile = modulePath + '/' + module.name;
809+
var moduleFile = path.join(rootpath, modulePath + '/' + module.name);
810810

811811
try {
812812

0 commit comments

Comments
 (0)