Skip to content

Commit 5d63fa9

Browse files
chore: minor tweaks on status
1 parent a685ae3 commit 5d63fa9

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/commands/agent/validate/authoring-bundle.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ export default class AgentValidateAuthoringBundle extends SfCommand<AgentValidat
6464
stage: 'Validating Authoring Bundle',
6565
label: 'Status',
6666
type: 'dynamic-key-value',
67-
get: (data): string | undefined => data?.status ?? 'In Progress',
67+
get: (data): string => data?.status ?? 'IN PROGRESS',
6868
},
6969
{
7070
stage: 'Validating Authoring Bundle',
7171
label: 'Errors',
7272
type: 'dynamic-key-value',
73-
get: (data): string | undefined => data?.errors ?? '0',
73+
get: (data): string => data?.errors ?? '0',
7474
},
7575
],
7676
});
@@ -81,11 +81,8 @@ export default class AgentValidateAuthoringBundle extends SfCommand<AgentValidat
8181
const conn = targetOrg.getConnection(flags['api-version']);
8282
// Call Agent.compileAfScript() API
8383
await sleep(Duration.seconds(2));
84-
const result = await Agent.compileAfScript(
85-
conn,
86-
readFileSync(join(authoringBundleDir, `${flags['api-name']}.agent`), 'utf8')
87-
);
88-
mso.updateData({ status: result !== undefined ? 'Success' : 'Failure' });
84+
await Agent.compileAfScript(conn, readFileSync(join(authoringBundleDir, `${flags['api-name']}.agent`), 'utf8'));
85+
mso.updateData({ status: 'COMPLETED' });
8986
mso.stop('completed');
9087
return {
9188
success: true,
@@ -104,8 +101,8 @@ export default class AgentValidateAuthoringBundle extends SfCommand<AgentValidat
104101
})
105102
.join('\n');
106103

107-
mso.updateData({ errors: count.toString(), status: 'Failure' });
108-
mso.stop();
104+
mso.updateData({ errors: count.toString(), status: 'ERROR' });
105+
mso.error();
109106

110107
this.log(messages.getMessage('error.compilationFailed', [formattedError]));
111108
return {

0 commit comments

Comments
 (0)