Skip to content

Commit

Permalink
Finish removing require.paths
Browse files Browse the repository at this point in the history
Fix require() completion bug in repl, and correct man output
  • Loading branch information
isaacs committed Jul 25, 2011
1 parent db99395 commit c050d0f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ and servers.
.SH ENVIRONMENT VARIABLES

.IP NODE_PATH
\':\'\-separated list of directories prefixed to the module search path,
require.paths.
\':\'\-separated list of directories prefixed to the module search path.

.IP NODE_MODULE_CONTEXTS
If set to 1 then modules will load in their own global contexts.
Expand Down
5 changes: 3 additions & 2 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ REPLServer.prototype.complete = function(line) {
var filter = match[1];
var dir, files, f, name, base, ext, abs, subfiles, s;
group = [];
for (i = 0; i < require.paths.length; i++) {
dir = path.resolve(require.paths[i], subdir);
var paths = module.paths.concat(require("module").globalPaths);
for (i = 0; i < paths.length; i++) {
dir = path.resolve(paths[i], subdir);
try {
files = fs.readdirSync(dir);
} catch (e) {
Expand Down
3 changes: 1 addition & 2 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2259,8 +2259,7 @@ static void PrintHelp() {
"\n"
"Enviromental variables:\n"
"NODE_PATH ':'-separated list of directories\n"
" prefixed to the module search path,\n"
" require.paths.\n"
" prefixed to the module search path.\n"
"NODE_MODULE_CONTEXTS Set to 1 to load modules in their own\n"
" global contexts.\n"
"NODE_DISABLE_COLORS Set to 1 to disable colors in the REPL\n"
Expand Down

0 comments on commit c050d0f

Please sign in to comment.