Skip to content

Commit 834ab4e

Browse files
authored
Merge pull request #279 from LambdaTest/dev
Release 1 dec
2 parents 2bc5b41 + 33da5d2 commit 834ab4e

File tree

4 files changed

+35
-7
lines changed

4 files changed

+35
-7
lines changed

commands/utils/utils.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
function split_at_pattern(s, pattern) {
2+
const res = [];
3+
let beg = 0;
4+
let inString = false;
5+
6+
for (let i = 0; i < s.length; i++) {
7+
if (s[i] === pattern && !inString) {
8+
res.push(s.substring(beg, i));
9+
beg = i + 1;
10+
} else if (s[i] === '"') {
11+
if (!inString) {
12+
inString = true;
13+
} else if (i > 0 && s[i - 1] !== '\\') {
14+
inString = false;
15+
}
16+
}
17+
}
18+
19+
res.push(s.substring(beg));
20+
return res;
21+
}
22+
23+
24+
module.exports = {
25+
split_at_pattern: split_at_pattern,
26+
};
27+

commands/utils/validate.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const fs = require("fs");
22
const semver = require("semver");
33
const semverCompare = require("semver/functions/compare");
4+
const { split_at_pattern } = require("./utils.js");
45

56
const constants = require("./constants.js");
67
module.exports = validate_config = function (lt_config, validation_configs) {
@@ -208,18 +209,18 @@ module.exports = validate_config = function (lt_config, validation_configs) {
208209
validation_configs.blacklistCommands[i]
209210
);
210211
}
211-
let settings = lt_config["run_settings"]["cypress_settings"].split(";");
212-
//let setting_names = [];
212+
let settings = split_at_pattern(lt_config["run_settings"]["cypress_settings"], ';')
213213
let settings_flag = true;
214214
let setting_param = "";
215215
for (let i = 0; i < settings.length; i++) {
216+
let configs = split_at_pattern(settings[i],' ')
216217
if (
217218
validation_configs.blacklistCommands.some((rx) =>
218-
rx.test(settings[i].split(" ")[0])
219+
rx.test(configs[0])
219220
)
220221
) {
221222
settings_flag = false;
222-
setting_param = settings[i].split(" ")[0];
223+
setting_param = configs[0];
223224
break;
224225
}
225226
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lambdatest-cypress-cli",
3-
"version": "3.0.21",
3+
"version": "3.0.22",
44
"description": "The lambdatest-cypress-cli is LambdaTest's command-line interface (CLI) aimed to help you run your Cypress tests on LambdaTest platform.",
55
"homepage": "https://github.com/LambdaTest/lambdatest-cypress-cli",
66
"author": "LambdaTest <[email protected]>",

0 commit comments

Comments
 (0)