Comparing version 0.5.0 to 0.5.1
var path = require('path'); | ||
var fs = require('fs'); | ||
var _0777 = parseInt('0777', 8); | ||
@@ -19,3 +20,3 @@ module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; | ||
if (mode === undefined) { | ||
mode = 0777 & (~process.umask()); | ||
mode = _0777 & (~process.umask()); | ||
} | ||
@@ -64,3 +65,3 @@ if (!made) made = null; | ||
if (mode === undefined) { | ||
mode = 0777 & (~process.umask()); | ||
mode = _0777 & (~process.umask()); | ||
} | ||
@@ -67,0 +68,0 @@ if (!made) made = null; |
{ | ||
"name": "mkdirp", | ||
"description": "Recursively mkdir, like `mkdir -p`", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"author": "James Halliday <mail@substack.net> (http://substack.net)", | ||
"main": "./index", | ||
"main": "index.js", | ||
"keywords": [ | ||
@@ -22,4 +22,4 @@ "mkdir", | ||
"devDependencies": { | ||
"tap": "~0.4.0", | ||
"mock-fs": "~2.2.0" | ||
"tap": "1", | ||
"mock-fs": "2 >=2.7.0" | ||
}, | ||
@@ -26,0 +26,0 @@ "bin": "bin/cmd.js", |
@@ -5,2 +5,5 @@ var mkdirp = require('../').mkdirp; | ||
var test = require('tap').test; | ||
var _0777 = parseInt('0777', 8); | ||
var _0755 = parseInt('0755', 8); | ||
var _0744 = parseInt('0744', 8); | ||
@@ -17,3 +20,3 @@ var ps = [ '', 'tmp' ]; | ||
test('chmod-pre', function (t) { | ||
var mode = 0744 | ||
var mode = _0744 | ||
mkdirp(file, mode, function (er) { | ||
@@ -24,3 +27,3 @@ t.ifError(er, 'should not error'); | ||
t.ok(stat && stat.isDirectory(), 'should be directory'); | ||
t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); | ||
t.equal(stat && stat.mode & _0777, mode, 'should be 0744'); | ||
t.end(); | ||
@@ -32,3 +35,3 @@ }); | ||
test('chmod', function (t) { | ||
var mode = 0755 | ||
var mode = _0755 | ||
mkdirp(file, mode, function (er) { | ||
@@ -35,0 +38,0 @@ t.ifError(er, 'should not error'); |
@@ -5,2 +5,3 @@ var mkdirp = require('../').mkdirp; | ||
var test = require('tap').test; | ||
var _0755 = parseInt('0755', 8); | ||
@@ -33,3 +34,3 @@ var ps = [ '', 'tmp' ]; | ||
t.plan(2); | ||
mkdirp(file, 0755, function (err) { | ||
mkdirp(file, _0755, function (err) { | ||
t.ok(err); | ||
@@ -36,0 +37,0 @@ t.equal(err.code, 'ENOTDIR'); |
@@ -6,2 +6,4 @@ var mkdirp = require('../'); | ||
var test = require('tap').test; | ||
var _0777 = parseInt('0777', 8); | ||
var _0755 = parseInt('0755', 8); | ||
@@ -16,3 +18,3 @@ test('woo', function (t) { | ||
mkdirp(file, 0755, function (err) { | ||
mkdirp(file, _0755, function (err) { | ||
t.ifError(err); | ||
@@ -23,3 +25,3 @@ exists(file, function (ex) { | ||
t.ifError(err); | ||
t.equal(stat.mode & 0777, 0755); | ||
t.equal(stat.mode & _0777, _0755); | ||
t.ok(stat.isDirectory(), 'target not a directory'); | ||
@@ -26,0 +28,0 @@ }) |
@@ -5,2 +5,4 @@ var mkdirp = require('../'); | ||
var mockfs = require('mock-fs'); | ||
var _0777 = parseInt('0777', 8); | ||
var _0755 = parseInt('0755', 8); | ||
@@ -17,3 +19,3 @@ test('opts.fs sync', function (t) { | ||
mkdirp.sync(file, { fs: xfs, mode: 0755 }); | ||
mkdirp.sync(file, { fs: xfs, mode: _0755 }); | ||
xfs.exists(file, function (ex) { | ||
@@ -23,3 +25,3 @@ t.ok(ex, 'created file'); | ||
t.ifError(err); | ||
t.equal(stat.mode & 0777, 0755); | ||
t.equal(stat.mode & _0777, _0755); | ||
t.ok(stat.isDirectory(), 'target not a directory'); | ||
@@ -26,0 +28,0 @@ }); |
@@ -5,2 +5,4 @@ var mkdirp = require('../'); | ||
var mockfs = require('mock-fs'); | ||
var _0777 = parseInt('0777', 8); | ||
var _0755 = parseInt('0755', 8); | ||
@@ -17,3 +19,3 @@ test('opts.fs', function (t) { | ||
mkdirp(file, { fs: xfs, mode: 0755 }, function (err) { | ||
mkdirp(file, { fs: xfs, mode: _0755 }, function (err) { | ||
t.ifError(err); | ||
@@ -24,3 +26,3 @@ xfs.exists(file, function (ex) { | ||
t.ifError(err); | ||
t.equal(stat.mode & 0777, 0755); | ||
t.equal(stat.mode & _0777, _0755); | ||
t.ok(stat.isDirectory(), 'target not a directory'); | ||
@@ -27,0 +29,0 @@ }); |
@@ -6,2 +6,4 @@ var mkdirp = require('../'); | ||
var test = require('tap').test; | ||
var _0777 = parseInt('0777', 8); | ||
var _0755 = parseInt('0755', 8); | ||
@@ -12,3 +14,3 @@ test('sync perm', function (t) { | ||
mkdirp.sync(file, 0755); | ||
mkdirp.sync(file, _0755); | ||
exists(file, function (ex) { | ||
@@ -18,3 +20,3 @@ t.ok(ex, 'file created'); | ||
t.ifError(err); | ||
t.equal(stat.mode & 0777, 0755); | ||
t.equal(stat.mode & _0777, _0755); | ||
t.ok(stat.isDirectory(), 'target not a directory'); | ||
@@ -29,3 +31,3 @@ }); | ||
var file = '/tmp'; | ||
mkdirp.sync(file, 0755); | ||
mkdirp.sync(file, _0755); | ||
exists(file, function (ex) { | ||
@@ -32,0 +34,0 @@ t.ok(ex, 'file created'); |
@@ -6,2 +6,4 @@ var mkdirp = require('../'); | ||
var test = require('tap').test; | ||
var _0777 = parseInt('0777', 8); | ||
var _0755 = parseInt('0755', 8); | ||
@@ -12,3 +14,3 @@ test('async perm', function (t) { | ||
mkdirp(file, 0755, function (err) { | ||
mkdirp(file, _0755, function (err) { | ||
t.ifError(err); | ||
@@ -19,3 +21,3 @@ exists(file, function (ex) { | ||
t.ifError(err); | ||
t.equal(stat.mode & 0777, 0755); | ||
t.equal(stat.mode & _0777, _0755); | ||
t.ok(stat.isDirectory(), 'target not a directory'); | ||
@@ -28,3 +30,3 @@ }) | ||
test('async root perm', function (t) { | ||
mkdirp('/tmp', 0755, function (err) { | ||
mkdirp('/tmp', _0755, function (err) { | ||
if (err) t.fail(err); | ||
@@ -31,0 +33,0 @@ t.end(); |
@@ -6,5 +6,7 @@ var mkdirp = require('../').mkdirp; | ||
var test = require('tap').test; | ||
var _0777 = parseInt('0777', 8); | ||
var _0755 = parseInt('0755', 8); | ||
test('race', function (t) { | ||
t.plan(6); | ||
t.plan(10); | ||
var ps = [ '', 'tmp' ]; | ||
@@ -19,12 +21,8 @@ | ||
var res = 2; | ||
mk(file, function () { | ||
if (--res === 0) t.end(); | ||
}); | ||
mk(file); | ||
mk(file, function () { | ||
if (--res === 0) t.end(); | ||
}); | ||
mk(file); | ||
function mk (file, cb) { | ||
mkdirp(file, 0755, function (err) { | ||
mkdirp(file, _0755, function (err) { | ||
t.ifError(err); | ||
@@ -35,5 +33,4 @@ exists(file, function (ex) { | ||
t.ifError(err); | ||
t.equal(stat.mode & 0777, 0755); | ||
t.equal(stat.mode & _0777, _0755); | ||
t.ok(stat.isDirectory(), 'target not a directory'); | ||
if (cb) cb(); | ||
}); | ||
@@ -40,0 +37,0 @@ }) |
@@ -6,2 +6,4 @@ var mkdirp = require('../'); | ||
var test = require('tap').test; | ||
var _0777 = parseInt('0777', 8); | ||
var _0755 = parseInt('0755', 8); | ||
@@ -19,3 +21,3 @@ test('rel', function (t) { | ||
mkdirp(file, 0755, function (err) { | ||
mkdirp(file, _0755, function (err) { | ||
t.ifError(err); | ||
@@ -27,3 +29,3 @@ exists(file, function (ex) { | ||
process.chdir(cwd); | ||
t.equal(stat.mode & 0777, 0755); | ||
t.equal(stat.mode & _0777, _0755); | ||
t.ok(stat.isDirectory(), 'target not a directory'); | ||
@@ -30,0 +32,0 @@ }) |
@@ -5,2 +5,3 @@ var mkdirp = require('../'); | ||
var test = require('tap').test; | ||
var _0755 = parseInt('0755', 8); | ||
@@ -11,3 +12,3 @@ test('root', function (t) { | ||
mkdirp(file, 0755, function (err) { | ||
mkdirp(file, _0755, function (err) { | ||
if (err) throw err | ||
@@ -14,0 +15,0 @@ fs.stat(file, function (er, stat) { |
@@ -6,2 +6,4 @@ var mkdirp = require('../'); | ||
var test = require('tap').test; | ||
var _0777 = parseInt('0777', 8); | ||
var _0755 = parseInt('0755', 8); | ||
@@ -17,3 +19,3 @@ test('sync', function (t) { | ||
try { | ||
mkdirp.sync(file, 0755); | ||
mkdirp.sync(file, _0755); | ||
} catch (err) { | ||
@@ -28,3 +30,3 @@ t.fail(err); | ||
t.ifError(err); | ||
t.equal(stat.mode & 0777, 0755); | ||
t.equal(stat.mode & _0777, _0755); | ||
t.ok(stat.isDirectory(), 'target not a directory'); | ||
@@ -31,0 +33,0 @@ }); |
@@ -6,2 +6,4 @@ var mkdirp = require('../'); | ||
var test = require('tap').test; | ||
var _0777 = parseInt('0777', 8); | ||
var _0755 = parseInt('0755', 8); | ||
@@ -27,3 +29,3 @@ test('umask sync modes', function (t) { | ||
t.ifError(err); | ||
t.equal(stat.mode & 0777, (0777 & (~process.umask()))); | ||
t.equal(stat.mode & _0777, (_0777 & (~process.umask()))); | ||
t.ok(stat.isDirectory(), 'target not a directory'); | ||
@@ -30,0 +32,0 @@ }); |
@@ -6,2 +6,4 @@ var mkdirp = require('../'); | ||
var test = require('tap').test; | ||
var _0777 = parseInt('0777', 8); | ||
var _0755 = parseInt('0755', 8); | ||
@@ -22,3 +24,3 @@ test('implicit mode from umask', function (t) { | ||
t.ifError(err); | ||
t.equal(stat.mode & 0777, 0777 & (~process.umask())); | ||
t.equal(stat.mode & _0777, _0777 & (~process.umask())); | ||
t.ok(stat.isDirectory(), 'target not a directory'); | ||
@@ -25,0 +27,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21212
516
23