Skip to content

Commit 5767c8e

Browse files
committed
Update codeql.ts
1 parent fde574a commit 5767c8e

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

src/codeql.ts

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,17 @@ function getCodeQLForCmd(cmd: string): CodeQL {
210210
'database',
211211
'finalize',
212212
databasePath
213-
]);
213+
],
214+
{
215+
listeners: {
216+
stdout: (data: Buffer) => {
217+
core.debug("Debug" + data.toString());
218+
},
219+
stderr: (data: Buffer) => {
220+
core.error("Error occured" + data.toString());
221+
}
222+
}
223+
});
214224
},
215225
resolveQueries: async function(queries: string[]) {
216226
let output = '';
@@ -233,15 +243,6 @@ function getCodeQLForCmd(cmd: string): CodeQL {
233243
return JSON.parse(output);
234244
},
235245
databaseAnalyze: async function(databasePath: string, sarifFile: string, querySuite: string) {
236-
const options = {};
237-
options.listeners = {
238-
stdout: (data: Buffer) => {
239-
core.debug("Debug" + data.toString());
240-
},
241-
stderr: (data: Buffer) => {
242-
core.error("Error occured" + data.toString());
243-
}
244-
};
245246
await exec.exec(cmd, [
246247
'database',
247248
'analyze',
@@ -252,7 +253,17 @@ function getCodeQLForCmd(cmd: string): CodeQL {
252253
'--output=' + sarifFile,
253254
'--no-sarif-add-snippets',
254255
querySuite
255-
], options);
256+
],
257+
{
258+
listeners: {
259+
stdout: (data: Buffer) => {
260+
core.debug("Debug" + data.toString());
261+
},
262+
stderr: (data: Buffer) => {
263+
core.error("Error occured" + data.toString());
264+
}
265+
}
266+
});
256267
}
257268
};
258269
}

0 commit comments

Comments
 (0)