Skip to content

Commit b06c3c5

Browse files
committed
adding package.json into template and archive
1 parent 58e7269 commit b06c3c5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

bin/helpers/archiver.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const archiveSpecs = (runSettings, filePath) => {
88
var output = fs.createWriteStream(filePath);
99

1010
var cypressFolderPath = runSettings.cypress_proj_dir
11+
var packageJsonPath = runSettings.package_json_path
1112

1213
var archive = archiver('zip', {
1314
zlib: { level: 9 } // Sets the compression level.
@@ -37,7 +38,9 @@ const archiveSpecs = (runSettings, filePath) => {
3738

3839
let allowedFileTypes = [ 'js', 'json', 'txt', 'ts' ]
3940
allowedFileTypes.forEach(fileType => {
40-
archive.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: 'node_modules/**' });
41+
archive
42+
.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: 'node_modules/**' })
43+
.append(packageJsonPath, { name: 'package.json' });
4144
});
4245

4346
archive.finalize();

bin/templates/configTemplate.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ module.exports = function () {
1212
}
1313
],
1414
"run_settings": {
15-
"cypress_proj_dir" : "/path/to/cypress.json",
15+
"package_json_path": "/path/to/package.json",
16+
"cypress_proj_dir" : "/dir/to/cypress.json",
1617
"project": "project-name",
1718
"customBuildName": "build-name"
1819
},

0 commit comments

Comments
 (0)