Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

mkdirp update

  • Loading branch information...
commit f47392e8f6ea854cc014c2ced66f108b43ea0cd8 1 parent 7b573f7
@isaacs isaacs authored
View
2  node_modules/mkdirp/.gitignore.orig
@@ -1,2 +0,0 @@
-node_modules/
-npm-debug.log
View
5 node_modules/mkdirp/.gitignore.rej
@@ -1,5 +0,0 @@
---- /dev/null
-+++ .gitignore
-@@ -0,0 +1,2 @@
-+node_modules/
-+npm-debug.log
View
6 node_modules/mkdirp/examples/pow.js.orig
@@ -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
19 node_modules/mkdirp/examples/pow.js.rej
@@ -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);
-+}
View
28 node_modules/mkdirp/index.js
@@ -27,18 +27,10 @@ function mkdirP (p, mode, f, made) {
});
break;
- case 'EISDIR':
- case 'EPERM':
- // Operation not permitted or already is a dir.
- // This is the error you get when trying to mkdir('c:/')
- // 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':
+ // 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:
fs.stat(p, function (er2, stat) {
// if the stat fails, then that's super weird.
// let the original error be the failure reason.
@@ -46,10 +38,6 @@ function mkdirP (p, mode, f, made) {
else cb(null, made);
});
break;
-
- default:
- cb(er, made);
- break;
}
});
}
@@ -74,7 +62,10 @@ mkdirP.sync = function sync (p, mode, made) {
sync(p, mode, made);
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;
try {
stat = fs.statSync(p);
@@ -84,9 +75,6 @@ mkdirP.sync = function sync (p, mode, made) {
}
if (!stat.isDirectory()) throw err0;
break;
- default :
- throw err0
- break;
}
}
View
19 node_modules/mkdirp/package.json
@@ -1,7 +1,7 @@
{
"name": "mkdirp",
"description": "Recursively mkdir, like `mkdir -p`",
- "version": "0.3.3",
+ "version": "0.3.4",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
@@ -14,7 +14,7 @@
],
"repository": {
"type": "git",
- "url": "git://github.com/substack/node-mkdirp.git"
+ "url": "http://github.com/substack/node-mkdirp.git"
},
"scripts": {
"test": "tap test/*.js"
@@ -26,16 +26,7 @@
"engines": {
"node": "*"
},
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- "_id": "mkdirp@0.3.3",
- "dependencies": {},
- "optionalDependencies": {},
- "_engineSupported": true,
- "_npmVersion": "1.1.24",
- "_nodeVersion": "v0.7.10-pre",
- "_defaultsLoaded": true,
- "_from": "mkdirp@0.3"
+ "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",
+ "_id": "mkdirp@0.3.4",
+ "_from": "mkdirp@~0.3.3"
}
Please sign in to comment.
Something went wrong with that request. Please try again.