Skip to content

Commit

Permalink
Simplify doesGoExtractionOutputExist implementation
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
  • Loading branch information
Henry Mercer and Andrew Eisenberg committed Aug 31, 2022
1 parent fff56ee commit e466e75
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
8 changes: 2 additions & 6 deletions lib/analyze-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 8 additions & 12 deletions src/analyze-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ const pkg = require("../package.json");

interface AnalysisStatusReport
extends upload_lib.UploadStatusReport,
QueriesStatusReport {}
QueriesStatusReport { }

interface FinishStatusReport
extends actionsUtil.StatusReportBase,
actionsUtil.DatabaseCreationTimings,
AnalysisStatusReport {}
actionsUtil.DatabaseCreationTimings,
AnalysisStatusReport { }

interface FinishWithTrapUploadStatusReport extends FinishStatusReport {
/** Size of TRAP caches that we uploaded, in bytes. */
Expand Down Expand Up @@ -71,9 +71,9 @@ export async function sendStatusReport(
...statusReportBase,
...(config
? {
ml_powered_javascript_queries:
util.getMlPoweredJsQueriesStatus(config),
}
ml_powered_javascript_queries:
util.getMlPoweredJsQueriesStatus(config),
}
: {}),
...(stats || {}),
...(dbCreationTimings || {}),
Expand Down Expand Up @@ -106,15 +106,11 @@ function hasBadExpectErrorInput(): boolean {
*/
function doesGoExtractionOutputExist(config: Config): boolean {
const golangDbDirectory = util.getCodeQLDatabasePath(config, Language.go);
const extractedFiles = fs
return fs
.readdirSync(golangDbDirectory)
.filter(
.some(
(fileName) => fileName.endsWith(".trap") || fileName.endsWith(".trap.gz")
);
if (extractedFiles.length !== 0) {
return true;
}
return false;
}

async function run() {
Expand Down

0 comments on commit e466e75

Please sign in to comment.