update the bundled node-mkdirp to v0.3.4

This commit is contained in:
Nathan Rajlich 2012-08-21 19:03:17 -07:00
parent fcf705d9e0
commit 6bea3b32a6
6 changed files with 14 additions and 67 deletions

View file

@ -1,2 +0,0 @@
node_modules/
npm-debug.log

5
node_modules/mkdirp/.gitignore.rej generated vendored
View file

@ -1,5 +0,0 @@
--- /dev/null
+++ .gitignore
@@ -0,0 +1,2 @@
+node_modules/
+npm-debug.log

View file

@ -1,6 +0,0 @@
var mkdirp = require('mkdirp');
mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
if (err) console.error(err)
else console.log('pow!')
});

View file

@ -1,19 +0,0 @@
--- examples/pow.js
+++ examples/pow.js
@@ -1,6 +1,15 @@
-var mkdirp = require('mkdirp').mkdirp;
+var mkdirp = require('../').mkdirp,
+ mkdirpSync = require('../').mkdirpSync;
mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
if (err) console.error(err)
else console.log('pow!')
});
+
+try {
+ mkdirpSync('/tmp/bar/foo/baz', 0755);
+ console.log('double pow!');
+}
+catch (ex) {
+ console.log(ex);
+}

28
node_modules/mkdirp/index.js generated vendored
View file

@ -27,18 +27,10 @@ function mkdirP (p, mode, f, made) {
}); });
break; break;
case 'EISDIR': // In the case of any other error, just see if there's a dir
case 'EPERM': // there already. If so, then hooray! If not, then something
// Operation not permitted or already is a dir. // is borked.
// This is the error you get when trying to mkdir('c:/') default:
// on windows, or mkdir('/') on unix. Make sure it's a
// dir by falling through to the EEXIST case.
case 'EROFS':
// a read-only file system.
// However, the dir could already exist, in which case
// the EROFS error will be obscuring a EEXIST!
// Fallthrough to that case.
case 'EEXIST':
fs.stat(p, function (er2, stat) { fs.stat(p, function (er2, stat) {
// if the stat fails, then that's super weird. // if the stat fails, then that's super weird.
// let the original error be the failure reason. // let the original error be the failure reason.
@ -46,10 +38,6 @@ function mkdirP (p, mode, f, made) {
else cb(null, made); else cb(null, made);
}); });
break; break;
default:
cb(er, made);
break;
} }
}); });
} }
@ -74,7 +62,10 @@ mkdirP.sync = function sync (p, mode, made) {
sync(p, mode, made); sync(p, mode, made);
break; break;
case 'EEXIST' : // In the case of any other error, just see if there's a dir
// there already. If so, then hooray! If not, then something
// is borked.
default:
var stat; var stat;
try { try {
stat = fs.statSync(p); stat = fs.statSync(p);
@ -84,9 +75,6 @@ mkdirP.sync = function sync (p, mode, made) {
} }
if (!stat.isDirectory()) throw err0; if (!stat.isDirectory()) throw err0;
break; break;
default :
throw err0
break;
} }
} }

21
node_modules/mkdirp/package.json generated vendored
View file

@ -1,7 +1,7 @@
{ {
"name": "mkdirp", "name": "mkdirp",
"description": "Recursively mkdir, like `mkdir -p`", "description": "Recursively mkdir, like `mkdir -p`",
"version": "0.3.3", "version": "0.3.4",
"author": { "author": {
"name": "James Halliday", "name": "James Halliday",
"email": "mail@substack.net", "email": "mail@substack.net",
@ -14,7 +14,7 @@
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/substack/node-mkdirp.git" "url": "http://github.com/substack/node-mkdirp.git"
}, },
"scripts": { "scripts": {
"test": "tap test/*.js" "test": "tap test/*.js"
@ -26,19 +26,10 @@
"engines": { "engines": {
"node": "*" "node": "*"
}, },
"_npmUser": { "readme": "mkdirp\n======\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\nexample\n=======\n\npow.js\n------\n var mkdirp = require('mkdirp');\n \n mkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n });\n\nOutput\n pow!\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\nmethods\n=======\n\nvar mkdirp = require('mkdirp');\n\nmkdirp(dir, mode, cb)\n---------------------\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\nmkdirp.sync(dir, mode)\n----------------------\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n npm install mkdirp\n\nlicense\n=======\n\nMIT/X11\n",
"name": "tootallnate", "_id": "mkdirp@0.3.4",
"email": "nathan@tootallnate.net"
},
"_id": "mkdirp@0.3.3",
"dependencies": {},
"optionalDependencies": {},
"_engineSupported": true,
"_npmVersion": "1.1.18",
"_nodeVersion": "v0.6.18",
"_defaultsLoaded": true,
"dist": { "dist": {
"shasum": "55f3d469ed6dac2b15ba71a69ca9d2bdd166cb01" "shasum": "8a974c8cc5179b91f37d4003fd7604266e9a0d67"
}, },
"_from": "mkdirp@0.3" "_from": "mkdirp@0.3.4"
} }