diff options
author | isaacs <i@izs.me> | 2011-10-04 04:36:30 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-10-04 04:36:30 +0400 |
commit | b240b939271ada4379f6a778470aefd8991e88d4 (patch) | |
tree | c8e8715c448ce3820affd8232f8d6d7515a4695f | |
parent | 87d3689caa21ce7f9ab0624cdaeb7998a809507e (diff) |
Fix #1491 Don't try to mkdir('/')
-rw-r--r-- | lib/utils/mkdir-p.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils/mkdir-p.js b/lib/utils/mkdir-p.js index e5245da71..212e50295 100644 --- a/lib/utils/mkdir-p.js +++ b/lib/utils/mkdir-p.js @@ -27,6 +27,12 @@ function mkdir (ensure, mode, uid, gid, cb_) { ensure = path.resolve(ensure).replace(/\/+$/, '') + // mkdir("/") should not do anything, since that always exists. + if (!ensure + || (process.platform === "win32" && p.match(/^[a-zA-Z]:(\\|\/)?$/))) { + return cb_() + } + if (mkdirCache.hasOwnProperty(ensure)) { return mkdirCache[ensure].push(cb_) } |