Permalink
Browse files

Removed most modifications of require.paths:

http://nodejs.org/docs/v0.4.7/api/modules.html#_Note_Please_Avoid_Modifying_require.paths_

This also fixes a bug whereby running the nodejs app from a different
directory wouldn't work.
  • Loading branch information...
1 parent c0d7446 commit 5c04d92b90fee8b7ddf46b53379c1e1e6671f668 @josephg josephg committed May 18, 2011
Showing with 11 additions and 11 deletions.
  1. +2 −2 Node/config.js
  2. +5 −6 Node/nodekit.js
  3. +2 −2 Node/router.js
  4. +1 −0 Node/shell/index.js
  5. +1 −1 Node/shell/shell.js
View
@@ -1,6 +1,6 @@
var EventEmitter = require('events').EventEmitter,
- extend = require('misc').extend,
- composePath = require('misc').composePath,
+ extend = require('./misc').extend,
+ composePath = require('./misc').composePath,
fs = require('fs'),
singleton;
View
@@ -1,17 +1,16 @@
var termkit = {
version: 1,
};
-require.paths.unshift('./socket.io-node/lib');
-require.paths.unshift('.');
-require.paths.unshift('../Shared/');
+
+require.paths.unshift(__dirname + '/../Shared/');
// Load requirements.
var http = require('http'),
- io = require('socket.io')
- router = require("router");
+ io = require('./socket.io-node'),
+ router = require("./router");
// Load config file.
-var config = require('config').getConfig();
+var config = require('./config').getConfig();
// Set up http server.
var server = http.createServer(function (request, result) {
View
@@ -1,5 +1,5 @@
-var shell = require("shell/shell");
-var returnMeta = require('misc').returnMeta;
+var shell = require('./shell');
+var returnMeta = require('./misc').returnMeta;
var protocol = require('protocol');
/**
View
@@ -0,0 +1 @@
+module.exports = require('./shell');
View
@@ -3,7 +3,7 @@ var fs = require('fs'), net = require('net');
var spawn = require('child_process').spawn,
exec = require('child_process').exec;
-var config = require('config').getConfig();
+var config = require('../config').getConfig();
exports.shell = function (args, router) {

0 comments on commit 5c04d92

Please sign in to comment.