From 01d99449a0c62dc8204978097d19064590f968c6 Mon Sep 17 00:00:00 2001 From: roshan04 Date: Tue, 6 Jun 2023 13:55:35 +0530 Subject: [PATCH] added decompress module changes --- bin/helpers/buildArtifacts.js | 11 +++++++---- bin/helpers/reporterHTML.js | 13 +++++++------ package.json | 3 ++- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/bin/helpers/buildArtifacts.js b/bin/helpers/buildArtifacts.js index 620fc44e..ca6cb518 100644 --- a/bin/helpers/buildArtifacts.js +++ b/bin/helpers/buildArtifacts.js @@ -127,10 +127,13 @@ const downloadAndUnzip = async (filePath, fileName, url) => { const unzipFile = async (filePath, fileName) => { return new Promise( async (resolve, reject) => { - await unzipper.Open.file(path.join(filePath, fileName)) - .then(d => d.extract({path: filePath, concurrency: 5})) - .catch((err) => reject(err)); - resolve(); + await decompress(path.join(filePath, fileName), filePath) + .then((files) => { + resolve(); + }) + .catch((error) => { + reject(error); + }); }); } diff --git a/bin/helpers/reporterHTML.js b/bin/helpers/reporterHTML.js index dd8f605c..575c1bbe 100644 --- a/bin/helpers/reporterHTML.js +++ b/bin/helpers/reporterHTML.js @@ -150,14 +150,15 @@ function getReportResponse(filePath, fileName, reportJsonUrl) { const unzipFile = async (filePath, fileName) => { return new Promise( async (resolve, reject) => { - await unzipper.Open.file(path.join(filePath, fileName)) - .then(d => d.extract({path: filePath, concurrency: 5})) - .catch((err) => { - reject(err); - process.exitCode = Constants.ERROR_EXIT_CODE; - }); + await decompress(path.join(filePath, fileName), filePath) + .then((files) => { let message = "Unzipped the json and html successfully." resolve(message); + }) + .catch((error) => { + reject(error); + process.exitCode = Constants.ERROR_EXIT_CODE; + }); }); } diff --git a/package.json b/package.json index 503d3961..898255ee 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "update-notifier": "5.1.0", "uuid": "8.3.2", "winston": "2.4.4", - "yargs": "14.2.3" + "yargs": "14.2.3", + "decompress": "4.2.1" }, "repository": { "type": "git",