browserstack-cypress-cli
Advanced tools
Comparing version 1.31.4 to 1.31.5
@@ -13,4 +13,4 @@ 'use strict'; | ||
const decompress = require('decompress'); | ||
const unzipper = require("unzipper"); | ||
let BUILD_ARTIFACTS_TOTAL_COUNT = 0; | ||
@@ -125,9 +125,11 @@ let BUILD_ARTIFACTS_FAIL_COUNT = 0; | ||
writer.on('close', async () => { | ||
if (!error) { | ||
await unzipFile(filePath, fileName); | ||
fs.unlinkSync(tmpFilePath); | ||
resolve(true); | ||
try { | ||
if (!error) { | ||
await unzipFile(filePath, fileName); | ||
fs.unlinkSync(tmpFilePath); | ||
} | ||
} catch (error) { | ||
reject(error); | ||
} | ||
//no need to call the reject here, as it will have been called in the | ||
//'error' stream; | ||
resolve(true); | ||
}); | ||
@@ -141,9 +143,21 @@ } | ||
return new Promise( async (resolve, reject) => { | ||
await decompress(path.join(filePath, fileName), filePath) | ||
.then((files) => { | ||
try { | ||
await decompress(path.join(filePath, fileName), filePath); | ||
resolve(); | ||
}) | ||
.catch((error) => { | ||
reject(error); | ||
}); | ||
} catch (error) { | ||
logger.debug(`Error unzipping with decompress, trying with unzipper. Stacktrace: ${error}.`); | ||
try { | ||
fs.createReadStream(path.join(filePath, fileName)) | ||
.pipe(unzipper.Extract({ path: filePath })) | ||
.on("close", () => { | ||
resolve(); | ||
}) | ||
.on("error", (err) => { | ||
reject(err); | ||
}); | ||
} catch (unzipperError) { | ||
logger.debug(`Unzipper package error: ${unzipperError}`); | ||
reject(Constants.userMessages.BUILD_ARTIFACTS_UNZIP_FAILURE); | ||
} | ||
} | ||
}); | ||
@@ -150,0 +164,0 @@ } |
@@ -126,3 +126,4 @@ let config = require("./config"); | ||
CYPRESS_INTERACTIVE_SESSION_CONFLICT_VALUES: | ||
"Conflicting values (True & False) were found for the interactive_debugging capability. Please resolve this issue to proceed further." | ||
"Conflicting values (True & False) were found for the interactive_debugging capability. Please resolve this issue to proceed further.", | ||
BUILD_ARTIFACTS_UNZIP_FAILURE: "Failed to unzip build artifacts.", | ||
}; | ||
@@ -129,0 +130,0 @@ |
{ | ||
"name": "browserstack-cypress-cli", | ||
"version": "1.31.4", | ||
"version": "1.31.5", | ||
"description": "BrowserStack Cypress CLI for Cypress integration with BrowserStack's remote devices.", | ||
@@ -37,3 +37,4 @@ "main": "index.js", | ||
"yargs": "14.2.3", | ||
"decompress": "4.2.1" | ||
"decompress": "4.2.1", | ||
"unzipper": "^0.12.3" | ||
}, | ||
@@ -40,0 +41,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1905330
10717
24
+ Addedunzipper@^0.12.3
+ Addedbluebird@3.7.2(transitive)
+ Addedduplexer2@0.1.4(transitive)
+ Addedfs-extra@11.2.0(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addednode-int64@0.4.0(transitive)
+ Addeduniversalify@2.0.1(transitive)
+ Addedunzipper@0.12.3(transitive)