Skip to content

Commit

Permalink
check !isDirectory() instead of isFile() so that <(echo "beep") inlin…
Browse files Browse the repository at this point in the history
…e bash fds work
  • Loading branch information
James Halliday committed Mar 29, 2013
1 parent 71d6159 commit c396065
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function resolve (x, opts, cb) {
fs.stat(file, function (err, stat) {
if (err && err.code === 'ENOENT') cb(null, false)
else if (err) cb(err)
else cb(null, stat.isFile())
else cb(null, !stat.isDirectory())
});
};
var readFile = opts.readFile || fs.readFile;
Expand Down
2 changes: 1 addition & 1 deletion lib/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function (x, opts) {

if (!opts) opts = {};
var isFile = opts.isFile || function (file) {
return existsSync(file) && fs.statSync(file).isFile()
return existsSync(file) && !fs.statSync(file).isDirectory()
};
var readFileSync = opts.readFileSync || fs.readFileSync;

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" : "resolve like require.resolve() on behalf of files asynchronously and synchronously",
"version" : "0.3.0",
"version" : "0.3.1",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/node-resolve.git"
Expand Down

0 comments on commit c396065

Please sign in to comment.