Skip to content

Commit

Permalink
Merge pull request #15 from browserstack/npm-package-support-win10
Browse files Browse the repository at this point in the history
Installing npm packages support win10
  • Loading branch information
suryart authored May 21, 2020
2 parents 27458d1 + acc919f commit a2e86e6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Here are all the options that you can provide in the `browserstack.json`:
### Authentication

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

| Option | Description | Possible values |
| ------------ | ----------------------------- | --------------- |
Expand Down
10 changes: 8 additions & 2 deletions bin/helpers/archiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const archiveSpecs = (runSettings, filePath) => {
return new Promise(function (resolve, reject) {
var output = fs.createWriteStream(filePath);

var cypressFolderPath = runSettings.cypress_proj_dir
var cypressFolderPath = runSettings.cypress_proj_dir;

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

archive.pipe(output);


let allowedFileTypes = [ 'js', 'json', 'txt', 'ts' ]
allowedFileTypes.forEach(fileType => {
archive.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: 'node_modules/**' });
archive.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: ['node_modules/**', 'package-lock.json', 'package.json', '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
4 changes: 3 additions & 1 deletion bin/templates/configTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ module.exports = function () {
"run_settings": {
"cypress_proj_dir" : "/path/to/cypress.json",
"project_name": "project-name",
"build_name": "build-name"
"build_name": "build-name",
"npm_dependencies": {
}
},
"connection_settings": {
"local": false,
Expand Down

0 comments on commit a2e86e6

Please sign in to comment.