Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Afd fix corrupt report issue #588

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions bin/helpers/buildArtifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
}

Expand Down
13 changes: 7 additions & 6 deletions bin/helpers/reporterHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
});
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down