browserstack-cypress-cli 1.37.0 → 1.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,7 +11,7 @@ const logger = require('./logger').winstonLogger,
|
|
|
11
11
|
const { default: axios } = require('axios');
|
|
12
12
|
const { HttpsProxyAgent = require('https-proxy-agent') } = require('https-proxy-agent');
|
|
13
13
|
const FormData = require('form-data');
|
|
14
|
-
const
|
|
14
|
+
const AdmZip = require('adm-zip');
|
|
15
15
|
const unzipper = require("unzipper");
|
|
16
16
|
const { setAxiosProxy } = require('./helper');
|
|
17
17
|
|
|
@@ -154,10 +154,11 @@ const downloadAndUnzip = async (filePath, fileName, url) => {
|
|
|
154
154
|
const unzipFile = async (filePath, fileName) => {
|
|
155
155
|
return new Promise( async (resolve, reject) => {
|
|
156
156
|
try {
|
|
157
|
-
|
|
157
|
+
const zip = new AdmZip(path.join(filePath, fileName));
|
|
158
|
+
await zip.extractAllToAsync(filePath, /* overwrite */ true);
|
|
158
159
|
resolve();
|
|
159
160
|
} catch (error) {
|
|
160
|
-
logger.debug(`Error unzipping with
|
|
161
|
+
logger.debug(`Error unzipping with adm-zip, trying with unzipper. Stacktrace: ${error}.`);
|
|
161
162
|
try {
|
|
162
163
|
fs.createReadStream(path.join(filePath, fileName))
|
|
163
164
|
.pipe(unzipper.Extract({ path: filePath }))
|
|
@@ -6,7 +6,7 @@ const fs = require('fs'),
|
|
|
6
6
|
utils = require("./utils"),
|
|
7
7
|
Constants = require('./constants'),
|
|
8
8
|
config = require("./config"),
|
|
9
|
-
|
|
9
|
+
AdmZip = require('adm-zip');
|
|
10
10
|
const { isTurboScaleSession } = require('../helpers/atsHelper');
|
|
11
11
|
|
|
12
12
|
const { setAxiosProxy } = require('./helper');
|
|
@@ -171,15 +171,14 @@ function getReportResponse(filePath, fileName, reportJsonUrl) {
|
|
|
171
171
|
|
|
172
172
|
const unzipFile = async (filePath, fileName) => {
|
|
173
173
|
return new Promise( async (resolve, reject) => {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
resolve(
|
|
178
|
-
})
|
|
179
|
-
.catch((error) => {
|
|
174
|
+
try {
|
|
175
|
+
const zip = new AdmZip(path.join(filePath, fileName));
|
|
176
|
+
await zip.extractAllToAsync(filePath, /* overwrite */ true);
|
|
177
|
+
resolve("Unzipped the json and html successfully.");
|
|
178
|
+
} catch (error) {
|
|
180
179
|
reject(error);
|
|
181
180
|
process.exitCode = Constants.ERROR_EXIT_CODE;
|
|
182
|
-
}
|
|
181
|
+
}
|
|
183
182
|
});
|
|
184
183
|
}
|
|
185
184
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browserstack-cypress-cli",
|
|
3
|
-
"version": "1.37.
|
|
3
|
+
"version": "1.37.1",
|
|
4
4
|
"description": "BrowserStack Cypress CLI for Cypress integration with BrowserStack's remote devices.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"browserstack-cypress": "bin/runner.js"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
+
"adm-zip": "0.6.1",
|
|
15
16
|
"archiver": "5.3.0",
|
|
16
17
|
"async": "3.2.3",
|
|
17
18
|
"axios": "^1.15.0",
|
|
@@ -19,7 +20,6 @@
|
|
|
19
20
|
"browserstack-local": "^1.5.12",
|
|
20
21
|
"chalk": "4.1.2",
|
|
21
22
|
"cli-progress": "^3.10.0",
|
|
22
|
-
"decompress": "4.2.1",
|
|
23
23
|
"detect-port": "1.5.1",
|
|
24
24
|
"form-data": "^4.0.0",
|
|
25
25
|
"fs-extra": "8.1.0",
|