Skip to content

Commit a8491de

Browse files
Change result to results show (#61)
Co-authored-by: Pedro Lopes <Pedro.Lopes@checkmarx.com>
1 parent 2ca20df commit a8491de

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/wrapper/CxConstants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export enum CxConstants {
2525
SUB_CMD_CREATE = "create",
2626
CMD_TRIAGE = "triage",
2727
SUB_CMD_UPDATE = "update",
28-
CMD_RESULT = "result",
28+
CMD_RESULT = "results",
2929
SCAN_INFO_FORMAT = "--scan-info-format",
3030
FORMAT = "--format",
3131
FORMAT_JSON = "json",

src/main/wrapper/CxWrapper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class CxWrapper {
172172
async getResultsList(scanId: string) {
173173
const exec = new ExecutionService();
174174
const fileName = new Date().getTime().toString();
175-
const commands = this.createResultCommand(scanId, CxConstants.FORMAT_JSON, fileName, os.tmpdir())
175+
const commands = this.resultsShow(scanId, CxConstants.FORMAT_JSON, fileName, os.tmpdir())
176176
// Executes the command and creates a result file
177177
await exec.executeResultsCommands(this.config.pathToExecutable, commands)
178178
// Reads the result file and retrieves the results
@@ -182,21 +182,21 @@ export class CxWrapper {
182182
async getResultsSummary(scanId: string): Promise<CxCommandOutput> {
183183
const exec = new ExecutionService();
184184
const fileName = new Date().getTime().toString();
185-
const commands = this.createResultCommand(scanId, CxConstants.FORMAT_HTML_CLI, fileName, os.tmpdir());
185+
const commands = this.resultsShow(scanId, CxConstants.FORMAT_HTML_CLI, fileName, os.tmpdir());
186186
// Executes the command and creates a result file
187187
await exec.executeResultsCommands(this.config.pathToExecutable, commands);
188188
// Reads the result file and retrieves the results
189189
return exec.executeResultsCommandsFile(scanId, CxConstants.FORMAT_HTML, CxConstants.FORMAT_HTML_FILE, commands,this.config.pathToExecutable,fileName);
190190
}
191191

192192
async getResults(scanId: string, resultType:string, outputFileName: string, outputFilePath: string) {
193-
const commands = this.createResultCommand(scanId, resultType, outputFileName, outputFilePath)
193+
const commands = this.resultsShow(scanId, resultType, outputFileName, outputFilePath)
194194
const exec = new ExecutionService();
195195
return await exec.executeCommands(this.config.pathToExecutable, commands);
196196
}
197197

198-
createResultCommand(scanId: string, reportFormat: string, outputFileName: string, outputPath: string): string[] {
199-
const commands: string[] = [CxConstants.CMD_RESULT, CxConstants.SCAN_ID, scanId,CxConstants.REPORT_FORMAT , reportFormat];
198+
resultsShow(scanId: string, reportFormat: string, outputFileName: string, outputPath: string): string[] {
199+
const commands: string[] = [CxConstants.CMD_RESULT,CxConstants.SUB_CMD_SHOW, CxConstants.SCAN_ID, scanId,CxConstants.REPORT_FORMAT , reportFormat];
200200
if (outputFileName) {
201201
commands.push(CxConstants.OUTPUT_NAME);
202202
commands.push(outputFileName);

0 commit comments

Comments
 (0)