Skip to content

Commit be56249

Browse files
authored
Merge branch 'master' into fix_o11y_timeouts
2 parents af0b361 + 42a6b2c commit be56249

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

bin/helpers/packageInstaller.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
{ get_version } = require('./usageReporting'),
1010
process = require('process'),
1111
{ spawn } = require('child_process'),
12+
cliUtils = require("./utils"),
1213
util = require('util');
1314

1415
let nodeProcess;
@@ -58,7 +59,7 @@ const setupPackageFolder = (runSettings, directoryPath) => {
5859
})
5960
};
6061

61-
const packageInstall = (packageDir) => {
62+
const packageInstall = (packageDir, bsConfig) => {
6263
return new Promise(function (resolve, reject) {
6364
const nodeProcessCloseCallback = (code) => {
6465
if(code == 0) {
@@ -74,6 +75,16 @@ const packageInstall = (packageDir) => {
7475
reject(`Packages were not installed successfully. Error Description ${util.format('%j', error)}`);
7576
};
7677

78+
// Moving .npmrc to tmpBstackPackages
79+
try {
80+
logger.debug(`Copying .npmrc file to temporary package directory`);
81+
const npmrcRootPath = path.join(cliUtils.isNotUndefined(bsConfig.run_settings.home_directory) ? path.resolve(bsConfig.run_settings.home_directory) : './', '.npmrc');
82+
const npmrcTmpPath = path.join(path.resolve(packageDir), '.npmrc');
83+
fs.copyFileSync(npmrcRootPath, npmrcTmpPath);
84+
} catch (error) {
85+
logger.debug(`Failed copying .npmrc to ${packageDir}: ${error}`)
86+
}
87+
7788
let nodeProcess;
7889
logger.debug(`Fetching npm version and its major version`);
7990
const npm_version = get_version('npm')
@@ -147,7 +158,7 @@ const packageSetupAndInstaller = (bsConfig, packageDir, instrumentBlocks) => {
147158
instrumentBlocks.markBlockEnd("packageInstaller.folderSetup");
148159
instrumentBlocks.markBlockStart("packageInstaller.packageInstall");
149160
logger.debug("Started installing dependencies specified in browserstack.json");
150-
return packageInstall(packageDir);
161+
return packageInstall(packageDir, bsConfig);
151162
}).then((_result) => {
152163
logger.debug("Completed installing dependencies");
153164
instrumentBlocks.markBlockEnd("packageInstaller.packageInstall");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "browserstack-cypress-cli",
3-
"version": "1.31.2",
3+
"version": "1.31.3",
44
"description": "BrowserStack Cypress CLI for Cypress integration with BrowserStack's remote devices.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)