Skip to content

Commit

Permalink
add npm dependencies only when it is provided in config
Browse files Browse the repository at this point in the history
  • Loading branch information
suryart committed May 21, 2020
1 parent f23ae64 commit acc919f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/helpers/archiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ const archiveSpecs = (runSettings, filePath) => {

archive.pipe(output);

var packageJSON = JSON.stringify({devDependencies: runSettings.npm_dependencies}, null, 4);

let allowedFileTypes = [ 'js', 'json', 'txt', 'ts' ]
allowedFileTypes.forEach(fileType => {
archive.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: ['node_modules/**', 'package-lock.json', 'package.json', 'browserstack-package.json'] });
});
archive.append(packageJSON, { name: 'browserstack-package.json' });

if (typeof runSettings.npm_dependencies === 'object') {
var packageJSON = JSON.stringify({devDependencies: runSettings.npm_dependencies}, null, 4);
archive.append(packageJSON, { name: 'browserstack-package.json' });
}

archive.finalize();
});
Expand Down

0 comments on commit acc919f

Please sign in to comment.