Skip to content

Commit 6b2c386

Browse files
committed
no need for mkdirp now and bare
1 parent 30ce1ce commit 6b2c386

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
const tar = require('tar-stream')
22
const pump = require('pump')
3-
const mkdirp = require('mkdirp-classic')
43
const fs = require('fs')
54
const path = require('path')
65

7-
const win32 = process.platform === 'win32'
6+
const win32 = (global.Bare?.platform || process.platform) === 'win32'
87

98
exports.pack = function pack (cwd, opts) {
109
if (!cwd) cwd = '.'
@@ -298,7 +297,7 @@ exports.extract = function extract (cwd, opts) {
298297
xfs.stat(name, function (err) {
299298
if (!err) return cb(null)
300299
if (err.code !== 'ENOENT') return cb(err)
301-
mkdirp(name, { fs: opts.fs, mode: opts.mode }, function (err, made) {
300+
xfs.mkdir(name, { mode: opts.mode, recursive: true }, function (err, made) {
302301
if (err) return cb(err)
303302
chperm(name, opts, cb)
304303
})

package.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,23 @@
33
"version": "3.0.4",
44
"description": "filesystem bindings for tar-stream",
55
"dependencies": {
6-
"mkdirp-classic": "^0.5.2",
76
"pump": "^3.0.0",
87
"tar-stream": "^3.1.5"
98
},
9+
"optionalDependencies": {
10+
"bare-fs": "^2.1.1",
11+
"bare-path": "^2.1.0"
12+
},
13+
"imports": {
14+
"fs": {
15+
"bare": "bare-fs",
16+
"default": "fs"
17+
},
18+
"path": {
19+
"bare": "bare-path",
20+
"default": "path"
21+
}
22+
},
1023
"files": [
1124
"index.js"
1225
],

0 commit comments

Comments
 (0)