Skip to content

Commit

Permalink
don't stop on the first node_modules since that's going away in node …
Browse files Browse the repository at this point in the history
…anyhow, all tests pass again
  • Loading branch information
James Halliday committed Jun 19, 2011
1 parent cf4f5a5 commit 9049abf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,9 @@ function loadNodeModulesSync (x, start) {

function nodeModulesPathsSync (start) {
var parts = start.split(/\/+/);
var root = parts.indexOf('node_modules');
if (root < 0) root = 0;

var dirs = [];
for (var i = parts.length - 1; i >= root; i--) {
for (var i = parts.length - 1; i >= 0; i--) {
if (parts[i] === 'node_modules') continue;
var dir = parts.slice(0, i + 1).join('/') + '/node_modules';
dirs.push(dir);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "resolve",
"description" : "A more hookable require.resolve() implementation",
"version" : "0.0.1",
"version" : "0.0.2",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/node-resolve.git"
Expand Down

0 comments on commit 9049abf

Please sign in to comment.