Permalink
Browse files

check !isDirectory() instead of isFile() so that <(echo "beep") inlin…

…e bash fds work
  • Loading branch information...
1 parent 71d6159 commit c3960650f1a1417e52238011e08a6da2b0d9fee4 @substack committed Mar 29, 2013
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/async.js
  2. +1 −1 lib/sync.js
  3. +1 −1 package.json
View
@@ -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;
View
@@ -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;
View
@@ -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"

0 comments on commit c396065

Please sign in to comment.