Skip to content

Commit

Permalink
use mkdirp v1
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jan 28, 2020
1 parent 2c9d359 commit eeb8649
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/mkdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const mkdir = module.exports = (dir, opt, cb) => {
})

if (preserve)
return mkdirp(dir, mode, done)
return mkdirp(dir, {mode}).then(made => done(null, made), done)

const sub = path.relative(cwd, dir)
const parts = sub.split(/\/|\\/)
Expand Down
32 changes: 25 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"fs-minipass": "^2.0.0",
"minipass": "^3.0.0",
"minizlib": "^2.1.0",
"mkdirp": "^0.5.0",
"mkdirp": "^1.0.3",
"yallist": "^4.0.0"
},
"devDependencies": {
Expand All @@ -35,7 +35,7 @@
},
"license": "ISC",
"engines": {
"node": ">= 8"
"node": ">= 10"
},
"files": [
"index.js",
Expand Down
8 changes: 4 additions & 4 deletions test/unpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ t.test('links!', t => {
const stripData = fs.readFileSync(tars + '/links-strip.tar')

t.plan(6)
t.beforeEach(cb => mkdirp(dir, cb))
t.beforeEach(cb => mkdirp(dir).then(() => cb(), cb))
t.afterEach(cb => rimraf(dir, cb))

const check = t => {
Expand Down Expand Up @@ -1722,7 +1722,7 @@ t.test('set owner', t => {
unl()
})

t.beforeEach(cb => mkdirp(dir, cb))
t.beforeEach(cb => mkdirp(dir).then(() => cb(), cb))
t.afterEach(cb => rimraf(dir, cb))

const check = t => {
Expand Down Expand Up @@ -1775,7 +1775,7 @@ t.test('unpack when dir is not writable', t => {
])

const dir = path.resolve(unpackdir, 'nowrite-dir')
t.beforeEach(cb => mkdirp(dir, cb))
t.beforeEach(cb => mkdirp(dir).then(() => cb(), cb))
t.afterEach(cb => rimraf(dir, cb))

const check = t => {
Expand Down Expand Up @@ -1812,7 +1812,7 @@ t.test('transmute chars on windows', t => {
])

const dir = path.resolve(unpackdir, 'winchars')
t.beforeEach(cb => mkdirp(dir, cb))
t.beforeEach(cb => mkdirp(dir).then(() => cb(), cb))
t.afterEach(cb => rimraf(dir, cb))

const hex = 'ef80bcef81bcef80beef80bfef80ba2e747874'
Expand Down

0 comments on commit eeb8649

Please sign in to comment.