Skip to content

Commit a2e86e6

Browse files
authored
Merge pull request #15 from browserstack/npm-package-support-win10
Installing npm packages support win10
2 parents 27458d1 + acc919f commit a2e86e6

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Here are all the options that you can provide in the `browserstack.json`:
104104
### Authentication
105105

106106
You can use the `auth` option to specify your username and access keys. You
107-
can find them in your [Automate dashboard](https://automate.browserstack.com/)
107+
can find them in your [Automate dashboard](https://automate.browserstack.com/)
108108

109109
| Option | Description | Possible values |
110110
| ------------ | ----------------------------- | --------------- |

bin/helpers/archiver.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const archiveSpecs = (runSettings, filePath) => {
88
return new Promise(function (resolve, reject) {
99
var output = fs.createWriteStream(filePath);
1010

11-
var cypressFolderPath = runSettings.cypress_proj_dir
11+
var cypressFolderPath = runSettings.cypress_proj_dir;
1212

1313
var archive = archiver('zip', {
1414
zlib: { level: 9 } // Sets the compression level.
@@ -36,11 +36,17 @@ const archiveSpecs = (runSettings, filePath) => {
3636

3737
archive.pipe(output);
3838

39+
3940
let allowedFileTypes = [ 'js', 'json', 'txt', 'ts' ]
4041
allowedFileTypes.forEach(fileType => {
41-
archive.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: 'node_modules/**' });
42+
archive.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: ['node_modules/**', 'package-lock.json', 'package.json', 'browserstack-package.json'] });
4243
});
4344

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+
}
49+
4450
archive.finalize();
4551
});
4652
}

bin/templates/configTemplate.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ module.exports = function () {
1414
"run_settings": {
1515
"cypress_proj_dir" : "/path/to/cypress.json",
1616
"project_name": "project-name",
17-
"build_name": "build-name"
17+
"build_name": "build-name",
18+
"npm_dependencies": {
19+
}
1820
},
1921
"connection_settings": {
2022
"local": false,

0 commit comments

Comments
 (0)