Skip to content

Commit acc919f

Browse files
committed
add npm dependencies only when it is provided in config
1 parent f23ae64 commit acc919f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bin/helpers/archiver.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@ const archiveSpecs = (runSettings, filePath) => {
3636

3737
archive.pipe(output);
3838

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

4140
let allowedFileTypes = [ 'js', 'json', 'txt', 'ts' ]
4241
allowedFileTypes.forEach(fileType => {
4342
archive.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: ['node_modules/**', 'package-lock.json', 'package.json', 'browserstack-package.json'] });
4443
});
45-
archive.append(packageJSON, { name: 'browserstack-package.json' });
44+
45+
if (typeof runSettings.npm_dependencies === 'object') {
46+
var packageJSON = JSON.stringify({devDependencies: runSettings.npm_dependencies}, null, 4);
47+
archive.append(packageJSON, { name: 'browserstack-package.json' });
48+
}
4649

4750
archive.finalize();
4851
});

0 commit comments

Comments
 (0)