diff --git a/index.js b/index.js index af07a24..a27bbcc 100644 --- a/index.js +++ b/index.js @@ -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 = '.' @@ -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) }) diff --git a/package.json b/package.json index c08ca8e..fd7f9b7 100644 --- a/package.json +++ b/package.json @@ -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" ],