Skip to content

Commit 59f7ba3

Browse files
committed
send npm_dependencies to archiver
1 parent b8a4625 commit 59f7ba3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

bin/commands/runs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function deleteZip() {
1818
logger.log(Constants.userMessages.ZIP_DELETE_FAILED);
1919
} else {
2020
logger.log(Constants.userMessages.ZIP_DELETED);
21-
}
21+
}
2222
});
2323
}
2424

@@ -31,7 +31,7 @@ function runCypress(args) {
3131
capabilityHelper.validate(bsConfig).then(function (validated) {
3232
logger.log(validated);
3333
// Archive the spec files
34-
archiver.archive(bsConfig.run_settings, config.fileName).then(function (data) {
34+
archiver.archive(bsConfig, config.fileName).then(function (data) {
3535
// Uploaded zip file
3636
zipUploader.zipUpload(bsConfig, config.fileName).then(function (zip) {
3737
// Create build

bin/helpers/archiver.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ const fs = require('fs'),
33
archiver = require('archiver'),
44
logger = require("./logger");
55

6-
const archiveSpecs = (runSettings, filePath) => {
6+
const archiveSpecs = (bsConfig, filePath) => {
77
return new Promise(function (resolve, reject) {
88
var output = fs.createWriteStream(filePath);
99

10-
var cypressFolderPath = runSettings.cypress_proj_dir
11-
var packageJsonPath = runSettings.package_json_path
10+
var cypressFolderPath = bsConfig.run_settings.cypress_proj_dir
1211

1312
var archive = archiver('zip', {
1413
zlib: { level: 9 } // Sets the compression level.
@@ -36,11 +35,13 @@ const archiveSpecs = (runSettings, filePath) => {
3635

3736
archive.pipe(output);
3837

38+
var packageJSON = JSON.stringify({devDependencies: bsConfig.npm_dependencies}, null, 4);
39+
3940
let allowedFileTypes = [ 'js', 'json', 'txt', 'ts' ]
4041
allowedFileTypes.forEach(fileType => {
4142
archive
4243
.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: 'node_modules/**' })
43-
.append(packageJsonPath, { name: 'package.json' });
44+
.append(packageJSON, { name: 'package.json' });
4445
});
4546

4647
archive.finalize();

0 commit comments

Comments
 (0)