You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.0 KiB

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.extractAsync = extractAsync;
function _spawnAsync() {
const data = _interopRequireDefault(require("@expo/spawn-async"));
_spawnAsync = function () {
return data;
};
return data;
}
function _tar() {
const data = _interopRequireDefault(require("tar"));
_tar = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
async function extractAsync(archive, dir) {
try {
if (process.platform !== 'win32') {
await (0, _spawnAsync().default)('tar', ['-xf', archive, '-C', dir], {
stdio: 'inherit',
cwd: __dirname
});
return;
}
} catch (e) {
console.error(e.message);
}
// tar node module has previously had problems with big files, and seems to
// be slower, so only use it as a backup.
await _tar().default.extract({
file: archive,
cwd: dir
});
}
//# sourceMappingURL=Extract.js.map