Skip to content

Commit

Permalink
no need for mkdirp now and bare
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Feb 9, 2024
1 parent 30ce1ce commit 6b2c386
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const tar = require('tar-stream')
const pump = require('pump')
const mkdirp = require('mkdirp-classic')
const fs = require('fs')
const path = require('path')

const win32 = process.platform === 'win32'
const win32 = (global.Bare?.platform || process.platform) === 'win32'

exports.pack = function pack (cwd, opts) {
if (!cwd) cwd = '.'
Expand Down Expand Up @@ -298,7 +297,7 @@ exports.extract = function extract (cwd, opts) {
xfs.stat(name, function (err) {
if (!err) return cb(null)
if (err.code !== 'ENOENT') return cb(err)
mkdirp(name, { fs: opts.fs, mode: opts.mode }, function (err, made) {
xfs.mkdir(name, { mode: opts.mode, recursive: true }, function (err, made) {
if (err) return cb(err)
chperm(name, opts, cb)
})
Expand Down
15 changes: 14 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@
"version": "3.0.4",
"description": "filesystem bindings for tar-stream",
"dependencies": {
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^3.1.5"
},
"optionalDependencies": {
"bare-fs": "^2.1.1",
"bare-path": "^2.1.0"
},
"imports": {
"fs": {
"bare": "bare-fs",
"default": "fs"
},
"path": {
"bare": "bare-path",
"default": "path"
}
},
"files": [
"index.js"
],
Expand Down

0 comments on commit 6b2c386

Please sign in to comment.