Skip to content

Commit

Permalink
remove mkdirp as a dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jun 26, 2024
1 parent 02b2687 commit 4004c5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
"chownr": "^3.0.0",
"minipass": "^7.1.2",
"minizlib": "^3.0.1",
"mkdirp": "^3.0.1",
"yallist": "^5.0.0"
},
"devDependencies": {
"chmodr": "^1.2.0",
"end-of-stream": "^1.4.3",
"events-to-array": "^2.0.3",
"mkdirp": "^3.0.1",
"mutate-fs": "^2.1.1",
"nock": "^13.5.4",
"prettier": "^3.2.5",
Expand Down
10 changes: 5 additions & 5 deletions src/mkdir.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { chownr, chownrSync } from 'chownr'
import fs from 'fs'
import { mkdirp, mkdirpSync } from 'mkdirp'
import fs from 'node:fs'
import fsp from 'node:fs/promises'
import path from 'node:path'
import { CwdError } from './cwd-error.js'
import { normalizeWindowsPath } from './normalize-windows-path.js'
Expand Down Expand Up @@ -48,7 +48,7 @@ const checkCwd = (
}

/**
* Wrapper around mkdirp for tar's needs.
* Wrapper around mkdir for tar's needs.
*
* The main purpose is to avoid creating directories if we know that
* they already exist (and track which ones exist for this purpose),
Expand Down Expand Up @@ -107,7 +107,7 @@ export const mkdir = (
}

if (preserve) {
return mkdirp(dir, { mode }).then(
return fsp.mkdir(dir, { recursive: true, mode }).then(
made => done(null, made ?? undefined), // oh, ts
done,
)
Expand Down Expand Up @@ -252,7 +252,7 @@ export const mkdirSync = (dir: string, opt: MkdirOptions) => {
}

if (preserve) {
return done(mkdirpSync(dir, mode) ?? undefined)
return done(fs.mkdirSync(dir, { recursive: true, mode }) ?? undefined)
}

const sub = normalizeWindowsPath(path.relative(cwd, dir))
Expand Down

0 comments on commit 4004c5e

Please sign in to comment.