Skip to content

Commit 64dc25b

Browse files
committed
build: update archiver, history, extract-zip
1 parent bd0e104 commit 64dc25b

File tree

3 files changed

+174
-201
lines changed

3 files changed

+174
-201
lines changed

package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"prebuild": "env-cmd -f ./.env node scripts/setup.js",
3737
"predist": "yarn build",
3838
"predist:win": "yarn build",
39-
"predist:mac": "yarn build",
4039
"predist:linux": "yarn build",
4140
"predist:posix": "yarn build",
4241
"prerelease": "yarn test:once && yarn build",
@@ -72,26 +71,26 @@
7271
"@material-ui/core": "4.11.0",
7372
"@material-ui/icons": "4.9.1",
7473
"@sentry/browser": "5.24.2",
75-
"@sentry/electron": "1.4.0",
74+
"@sentry/electron": "2.0.1",
7675
"about-window": "1.13.4",
77-
"archiver": "3.1.1",
76+
"archiver": "5.0.2",
7877
"bson-objectid": "1.3.1",
7978
"chai": "4.2.0",
8079
"cheerio": "1.0.0-rc.3",
8180
"classnames": "2.2.6",
8281
"clsx": "1.1.1",
8382
"connected-react-router": "6.8.0",
84-
"download": "7.1.0",
83+
"download": "8.0.0",
8584
"electron-devtools-installer": "2.2.4",
8685
"electron-is-dev": "1.2.0",
8786
"electron-log": "4.2.4",
8887
"electron-publisher-s3": "20.17.2",
8988
"electron-updater": "4.3.5",
9089
"enzyme": "3.11.0",
9190
"enzyme-adapter-react-16": "1.15.5",
92-
"extract-zip": "1.6.7",
91+
"extract-zip": "2.0.1",
9392
"fs-extra": "9.0.1",
94-
"history": "4.10.1",
93+
"history": "5.0.0",
9594
"i18next": "19.7.0",
9695
"immutable": "4.0.0-rc.12",
9796
"is-online": "8.4.0",

public/app/listeners/loadSpace.js

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const extract = require('extract-zip');
22
const _ = require('lodash');
3-
const { promisify } = require('util');
43
const fs = require('fs');
54
const ObjectId = require('bson-objectid');
65
const { VAR_FOLDER } = require('../config/config');
@@ -54,7 +53,7 @@ const renameSpaceFolder = async (prevPath, newPath) => {
5453
return wasRenamed;
5554
};
5655

57-
const extractFileToLoadSpace = mainWindow => async (
56+
const extractFileToLoadSpace = (mainWindow) => async (
5857
event,
5958
{ fileLocation }
6059
) => {
@@ -63,7 +62,7 @@ const extractFileToLoadSpace = mainWindow => async (
6362
// make temporary folder hidden
6463
const extractPath = `${VAR_FOLDER}/.${tmpId}`;
6564
try {
66-
await promisify(extract)(fileLocation, { dir: extractPath });
65+
await extract(fileLocation, { dir: extractPath });
6766

6867
// get basic information from manifest
6968
const manifestPath = `${extractPath}/manifest.json`;
@@ -102,7 +101,7 @@ const extractFileToLoadSpace = mainWindow => async (
102101
}
103102
};
104103

105-
const clearLoadSpace = mainWindow => async (event, { extractPath }) => {
104+
const clearLoadSpace = (mainWindow) => async (event, { extractPath }) => {
106105
const isCleanSuccessful = clean(extractPath);
107106
mainWindow.webContents.send(CLEAR_LOAD_SPACE_CHANNEL);
108107
return isCleanSuccessful;
@@ -158,9 +157,7 @@ const loadSpace = (mainWindow, db) => async (
158157
deleteSpaceAndResources(db, id, tmpPath);
159158

160159
// add new space in database
161-
db.get(SPACES_COLLECTION)
162-
.push(space)
163-
.write();
160+
db.get(SPACES_COLLECTION).push(space).write();
164161
} else {
165162
// clean temp space folder
166163
clean(extractPath);
@@ -181,7 +178,7 @@ const loadSpace = (mainWindow, db) => async (
181178
// keep only non-duplicate resources
182179
.filter(({ id }) => !savedResources.find({ id }).value())
183180
// change user id by current user id
184-
.map(resource => ({
181+
.map((resource) => ({
185182
...resource,
186183
user: userId,
187184
}));
@@ -202,7 +199,7 @@ const loadSpace = (mainWindow, db) => async (
202199
// keep only non-duplicate actions
203200
.filter(({ id }) => !savedActions.find({ id }).value())
204201
// change user id by current user id
205-
.map(action => ({ ...action, user: userId }));
202+
.map((action) => ({ ...action, user: userId }));
206203

207204
savedActions.push(...newActions).write();
208205
}

0 commit comments

Comments
 (0)