Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update fstream and mkdirp

The hope that this will fix #2078
  • Loading branch information...
commit cb262a31812366cea9c54abd6b7292f9dccbb70f 1 parent 81ee7cb
@isaacs isaacs authored
View
6 node_modules/fstream/package.json
@@ -2,7 +2,7 @@
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"name": "fstream",
"description": "Advanced file system stream things",
- "version": "0.1.11",
+ "version": "0.1.12",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/fstream.git"
@@ -12,8 +12,8 @@
"node": "0.5 || 0.6 || 0.7"
},
"dependencies": {
- "rimraf": "~1.0.8",
- "mkdirp": "~0.1.0",
+ "rimraf": "2",
+ "mkdirp": "0.3",
"graceful-fs": "~1.1.2",
"inherits": "~1.0.0"
},
View
37 node_modules/mkdirp/README.markdown
@@ -3,14 +3,14 @@ mkdirp
Like `mkdir -p`, but in node.js!
-Example
+example
=======
pow.js
------
var mkdirp = require('mkdirp');
- mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
+ mkdirp('/tmp/foo/bar/baz', function (err) {
if (err) console.error(err)
else console.log('pow!')
});
@@ -19,3 +19,36 @@ Output
pow!
And now /tmp/foo/bar/baz exists, huzzah!
+
+methods
+=======
+
+var mkdirp = require('mkdirp');
+
+mkdirp(dir, mode, cb)
+---------------------
+
+Create a new directory and any necessary subdirectories at `dir` with octal
+permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+mkdirp.sync(dir, mode)
+----------------------
+
+Synchronously create a new directory and any necessary subdirectories at `dir`
+with octal permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+install
+=======
+
+With [npm](http://npmjs.org) do:
+
+ npm install mkdirp
+
+license
+=======
+
+MIT/X11
View
45 node_modules/mkdirp/index.js
@@ -4,6 +4,11 @@ var fs = require('fs');
module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
function mkdirP (p, mode, f) {
+ if (typeof mode === 'function' || mode === undefined) {
+ f = mode;
+ mode = 0777 & (~process.umask());
+ }
+
var cb = f || function () {};
if (typeof mode === 'string') mode = parseInt(mode, 8);
p = path.resolve(p);
@@ -23,7 +28,6 @@ function mkdirP (p, mode, f) {
// if the stat fails, then that's super weird.
// let the original EEXIST be the failure reason.
if (er2 || !stat.isDirectory()) cb(er)
- else if ((stat.mode & 0777) !== mode) fs.chmod(p, mode, cb);
else cb();
});
break;
@@ -34,3 +38,42 @@ function mkdirP (p, mode, f) {
}
});
}
+
+mkdirP.sync = function sync (p, mode) {
+ if (mode === undefined) {
+ mode = 0777 & (~process.umask());
+ }
+
+ if (typeof mode === 'string') mode = parseInt(mode, 8);
+ p = path.resolve(p);
+
+ try {
+ fs.mkdirSync(p, mode)
+ }
+ catch (err0) {
+ switch (err0.code) {
+ case 'ENOENT' :
+ var err1 = sync(path.dirname(p), mode)
+ if (err1) throw err1;
+ else return sync(p, mode);
+ break;
+
+ case 'EEXIST' :
+ var stat;
+ try {
+ stat = fs.statSync(p);
+ }
+ catch (err1) {
+ throw err0
+ }
+ if (!stat.isDirectory()) throw err0;
+ else return null;
+ break;
+ default :
+ throw err0
+ break;
+ }
+ }
+
+ return null;
+};
View
2  node_modules/mkdirp/package.json
@@ -1,7 +1,7 @@
{
"name" : "mkdirp",
"description" : "Recursively mkdir, like `mkdir -p`",
- "version" : "0.1.0",
+ "version" : "0.3.0",
"author" : "James Halliday <mail@substack.net> (http://substack.net)",
"main" : "./index",
"keywords" : [
View
2  package.json
@@ -50,7 +50,7 @@
"fstream": "~0.1.5",
"block-stream": "*",
"inherits": "1",
- "mkdirp": "0.1",
+ "mkdirp": "0.3",
"fast-list": "~1.0.1",
"read": "0",
"lru-cache": "1"
Please sign in to comment.
Something went wrong with that request. Please try again.