Skip to content

Commit 0a07c6a

Browse files
Merge branch 'master' of github.com:browserstack/browserstack-cypress-cli into sync-cli-log-changes
2 parents 37d7936 + daf2106 commit 0a07c6a

File tree

7 files changed

+16
-8
lines changed

7 files changed

+16
-8
lines changed

bin/commands/info.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module.exports = function info(args) {
1818

1919
utils.setUsageReportingFlag(bsConfig, args.disableUsageReporting);
2020

21+
// set cypress config filename
22+
utils.setCypressConfigFilename(bsConfig, args);
23+
2124
let buildId = args._[1];
2225

2326
let options = {

bin/commands/init.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ function get_path(args) {
1313
if (filename !== path.basename(filename)) {
1414
let message = Constants.userMessages.CONFLICTING_INIT_ARGUMENTS;
1515
logger.error(message);
16+
// set cypress config filename
17+
utils.setCypressConfigFilename(args.bstack_config, args);
1618
utils.sendUsageReport(null, args, message, Constants.messageTypes.ERROR, 'conflicting_path_json_init');
1719
return;
1820
}

bin/commands/stop.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module.exports = function stop(args) {
1818

1919
utils.setUsageReportingFlag(bsConfig, args.disableUsageReporting);
2020

21+
// set cypress config filename
22+
utils.setCypressConfigFilename(bsConfig, args);
23+
2124
let buildId = args._[1];
2225

2326
let options = {

bin/helpers/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var config = require('./config.json');
22

3-
config.env = process.env.NODE_ENV || "production";
3+
config.env = process.env.BSTACK_CYPRESS_NODE_ENV || "production";
44

55
if(config.env !== "production") {
66
// load config based on env

bin/helpers/usageReporting.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ function local_cypress_version(bsConfig) {
3333
// 1. check version of Cypress installed in local project
3434
// 2. check version of Cypress installed globally if not present in project
3535

36-
if (bsConfig) {
37-
let version = get_version(path.join(bsConfig.run_settings.cypress_proj_dir, 'node_modules', '.bin', 'cypress'));
36+
if (bsConfig && bsConfig.run_settings.cypressProjectDir) {
37+
let version = get_version(path.join(bsConfig.run_settings.cypressProjectDir, 'node_modules', '.bin', 'cypress'));
3838
if (!version) {
3939
version = get_version('cypress');
4040
}
@@ -80,8 +80,8 @@ function cli_version_and_path(bsConfig) {
8080
// 1. check version of Cypress installed in local project
8181
// 2. check version of Cypress installed globally if not present in project
8282

83-
if (bsConfig) {
84-
let _path = path.join(bsConfig.run_settings.cypress_proj_dir, 'node_modules', 'browserstack-cypress');
83+
if (bsConfig && bsConfig.run_settings.cypressProjectDir) {
84+
let _path = path.join(bsConfig.run_settings.cypressProjectDir, 'node_modules', 'browserstack-cypress');
8585
let version = get_version(_path);
8686
if (!version) {
8787
version = get_version('browserstack-cypress');

bin/helpers/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ exports.setCypressConfigFilename = (bsConfig, args) => {
164164

165165
bsConfig.run_settings.userProvidedCypessConfigFile = (userProvidedCypessConfigFile || (!this.isUndefined(bsConfig.run_settings.cypress_config_file)));
166166

167-
if (userProvidedCypessConfigFile || this.isUndefined(bsConfig.run_settings.cypress_config_file)) {
167+
if ((userProvidedCypessConfigFile || this.isUndefined(bsConfig.run_settings.cypress_config_file)) && !this.isUndefined(args.cypressConfigFile)) {
168168
bsConfig.run_settings.cypress_config_file = args.cypressConfigFile;
169169
bsConfig.run_settings.cypress_config_filename = path.basename(args.cypressConfigFile);
170170
} else if (!this.isUndefined(bsConfig.run_settings.cypress_config_file)) {
@@ -219,7 +219,7 @@ exports.isParallelValid = (value) => {
219219
}
220220

221221
exports.getUserAgent = () => {
222-
return `BStack-Cypress-CLI/1.5.0 (${os.arch()}/${os.platform()}/${os.release()})`;
222+
return `BStack-Cypress-CLI/1.5.1 (${os.arch()}/${os.platform()}/${os.release()})`;
223223
};
224224

225225
exports.isAbsolute = (configPath) => {

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.4.0",
3+
"version": "1.5.0",
44
"description": "BrowserStack Cypress CLI for Cypress integration with BrowserStack's remote devices.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)