Skip to content

Commit caca9f9

Browse files
author
James Halliday
committed
this fixes the directory precedence problem
1 parent 9aa36e7 commit caca9f9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/async.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ module.exports = function resolve (x, opts, cb) {
6666
var remainder = pathAndRemainder.remainder;
6767

6868
isFile(pkgfile, function (err, ex) {
69-
//if (err) return cb(err);
7069
if (!ex) return load(exts, x);
7170

7271
readFile(pkgfile, function (err, body) {
73-
//if (err) return cb(err);
72+
if (err) return load(exts, x);
7473
try {
7574
pkg = JSON.parse(body);
7675
}
@@ -91,6 +90,9 @@ module.exports = function resolve (x, opts, cb) {
9190
});
9291
});
9392
}
93+
else if (x === y) {
94+
return loadAsDirectory(x, pkg, cb);
95+
}
9496
else {
9597
return load(exts, x);
9698
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"test": "tape test/*.js"
1818
},
1919
"devDependencies": {
20-
"tape": "^3.5.0"
20+
"tape": "^3.5.0",
21+
"tap": "0.4.13"
2122
},
2223
"license": "MIT",
2324
"author": {

0 commit comments

Comments
 (0)