[Updater > v1 > Module] Replace mkdirp with fs

This commit is contained in:
Ducko 2021-12-10 18:19:48 +00:00
parent 5855d95b44
commit b9f3656f34
3 changed files with 3 additions and 38 deletions

30
src/package-lock.json generated
View file

@ -6,7 +6,6 @@
"": {
"name": "openasar",
"dependencies": {
"mkdirp": "^0.5.1",
"request": "2.88.0",
"yauzl": "^2.10.0"
}
@ -283,22 +282,6 @@
"node": ">= 0.6"
}
},
"node_modules/minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
},
"node_modules/mkdirp": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"dependencies": {
"minimist": "^1.2.5"
},
"bin": {
"mkdirp": "bin/cmd.js"
}
},
"node_modules/oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
@ -712,19 +695,6 @@
"mime-db": "1.51.0"
}
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
},
"mkdirp": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"requires": {
"minimist": "^1.2.5"
}
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",

View file

@ -1,11 +1,8 @@
{
"name": "openasar",
"description": "Open-source alternative of Discord desktop's app.asar",
"main": "index.js",
"dependencies": {
"mkdirp": "^0.5.1",
"request": "2.88.0",
"yauzl": "^2.10.0"
}

View file

@ -22,8 +22,6 @@ var _module = _interopRequireDefault(require("module"));
var _events = require("events");
var _mkdirp = _interopRequireDefault(require("mkdirp"));
var _process = require("process");
var _yauzl = _interopRequireDefault(require("yauzl"));
@ -228,7 +226,7 @@ function init(_endpoint, _settings, _buildInfo) {
installedModulesFilePath = _path.default.join(moduleInstallPath, 'installed.json');
moduleDownloadPath = _path.default.join(moduleInstallPath, 'pending');
_mkdirp.default.sync(moduleDownloadPath);
_fs.default.mkdirSync(moduleDownloadPath, { recursive: true });
logger.log(`Module install path: ${moduleInstallPath}`);
logger.log(`Module installed file path: ${installedModulesFilePath}`);
@ -729,7 +727,7 @@ function processUnzipQueue() {
}
stream.on('error', e => onError(e, zipfile));
(0, _mkdirp.default)(_path.default.join(extractRoot, _path.default.dirname(entry.fileName)), err => {
_fs.default.mkdir(_path.default.join(extractRoot, _path.default.dirname(entry.fileName)), err => {
if (err) {
onError(err, zipfile);
return;
@ -766,7 +764,7 @@ function processUnzipQueue() {
zipfile.readEntry();
});
stream.pipe(writeStream);
});
}, { recursive: true });
});
});
zipfile.on('error', err => {