Skip to content

Commit df8852d

Browse files
authored
Merge pull request #184 from parthlambdatest/build_name_addition
handle empty string as well
2 parents 3c71977 + 5ee7e90 commit df8852d

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lambdatest/smartui-cli",
3-
"version": "4.0.13",
3+
"version": "4.0.14",
44
"description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
55
"files": [
66
"dist/**/*"

src/commander/capture.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ command
2121
.option('--fetch-results [filename]', 'Fetch results and optionally specify an output file, e.g., <filename>.json')
2222
.option('--buildName <string>', 'Specify the build name')
2323
.action(async function(file, _, command) {
24+
const options = command.optsWithGlobals();
25+
if (options.buildName === '') {
26+
console.log(`Error: The '--buildName' option cannot be an empty string.`);
27+
process.exit(1);
28+
}
2429
let ctx: Context = ctxInit(command.optsWithGlobals());
2530

2631
if (!fs.existsSync(file)) {

src/commander/exec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ command
2222
.option('--fetch-results [filename]', 'Fetch results and optionally specify an output file, e.g., <filename>.json')
2323
.option('--buildName <string>', 'Specify the build name')
2424
.action(async function(execCommand, _, command) {
25+
const options = command.optsWithGlobals();
26+
if (options.buildName === '') {
27+
console.log(`Error: The '--buildName' option cannot be an empty string.`);
28+
process.exit(1);
29+
}
2530
let ctx: Context = ctxInit(command.optsWithGlobals());
2631

2732
if (!which.sync(execCommand[0], { nothrow: true })) {

src/commander/upload.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ command
2828
.option('--fetch-results [filename]', 'Fetch results and optionally specify an output file, e.g., <filename>.json')
2929
.option('--buildName <string>', 'Specify the build name')
3030
.action(async function(directory, _, command) {
31+
const options = command.optsWithGlobals();
32+
if (options.buildName === '') {
33+
console.log(`Error: The '--buildName' option cannot be an empty string.`);
34+
process.exit(1);
35+
}
3136
let ctx: Context = ctxInit(command.optsWithGlobals());
3237

3338
if (!fs.existsSync(directory)) {

0 commit comments

Comments
 (0)