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

Add decompress support #623

Merged
merged 7 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions bin/helpers/buildArtifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
config = require("./config");

const request = require('request');
const decompress = require('decompress');


let BUILD_ARTIFACTS_TOTAL_COUNT = 0;
Expand Down Expand Up @@ -127,10 +128,13 @@

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)
Dismissed Show dismissed Hide dismissed
Dismissed Show dismissed Hide dismissed
.then((files) => {
resolve();
})
.catch((error) => {
reject(error);
});
});
}

Expand Down
16 changes: 9 additions & 7 deletions bin/helpers/reporterHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
logger = require('./logger').winstonLogger,
utils = require("./utils"),
Constants = require('./constants'),
config = require("./config");
config = require("./config"),
decompress = require('decompress');

let reportGenerator = (bsConfig, buildId, args, rawArgs, buildReportData, cb) => {
let options = {
Expand Down Expand Up @@ -150,14 +151,15 @@

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)
Dismissed Show dismissed Hide dismissed
Dismissed Show dismissed Hide dismissed
.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