diff options
-rw-r--r-- | lib/utils/mkdir-p.js | 5 | ||||
-rw-r--r-- | package.json | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/utils/mkdir-p.js b/lib/utils/mkdir-p.js index 5bf77509e..0e89eb450 100644 --- a/lib/utils/mkdir-p.js +++ b/lib/utils/mkdir-p.js @@ -5,6 +5,7 @@ var log = require("../utils/log") module.exports = mkdir function mkdir (ensure, chmod, cb) { + ensure = ensure.replace(/\/+$/, '') if (ensure.charAt(0) !== "/") ensure = path.join(process.cwd(), ensure) var dirs = ensure.split("/") , walker = [] @@ -17,7 +18,9 @@ function mkdir (ensure, chmod, cb) { if (d === undefined) return cb() walker.push(d) var dir = walker.join("/") - fs.stat(dir, function STATCB (er, s) { + // must be a real dir! + , stat = (dir === ensure) ? "lstat" : "stat" + fs[stat](dir, function STATCB (er, s) { if (er) { fs.mkdir(dir, chmod, function MKDIRCB (er, s) { if (er && er.message.indexOf("EEXIST") === 0) { diff --git a/package.json b/package.json index 8e2c62670..e30b3087f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "npm" , "description" : "A package manager for node" -, "version" : "0.1.27-3" +, "version" : "0.1.27-4" , "homepage" : "http://npmjs.org/" , "author" : "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)" , "contributors" : |