Skip to content

Commit ce7adff

Browse files
committed
fix exit code status
1 parent f267933 commit ce7adff

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
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.1.14",
3+
"version": "4.1.15",
44
"description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
55
"files": [
66
"dist/**/*"

src/tasks/createBuild.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
1919
baseline: resp.data.baseline,
2020
useKafkaFlow: resp.data.useKafkaFlow || false,
2121
}
22+
process.env.SMARTUI_BUILD = resp.data.buildId;
23+
process.env.SMARTUI_BUILD_NAME = resp.data.buildName;
2224
} else if (resp && resp.error) {
2325
if (resp.error.message) {
2426
ctx.log.error(`Error while creation of build: ${resp.error.message}`)

src/tasks/createBuildExec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
2121
baseline: resp.data.baseline,
2222
useKafkaFlow: resp.data.useKafkaFlow || false,
2323
}
24+
process.env.SMARTUI_BUILD = resp.data.buildId;
25+
process.env.SMARTUI_BUILD_NAME = resp.data.buildName;
2426
} else if (resp && resp.error) {
2527
if (resp.error.message) {
2628
ctx.log.error(`Error while creation of build: ${resp.error.message}`)

src/tasks/exec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
3838
childProcess.on('close', async (code, signal) => {
3939
if (code !== null) {
4040
task.title = `Execution of '${ctx.args.execCommand?.join(' ')}' completed; exited with code ${code}`;
41+
if (code !== 0) {
42+
reject();
43+
process.exitCode = code
44+
}
4145
} else if (signal !== null) {
4246
throw new Error(`Child process killed with signal ${signal}`);
4347
}
44-
48+
4549
resolve();
4650
});
4751
});

0 commit comments

Comments
 (0)