Skip to content

Commit

Permalink
Use a more explicit name for checking Go extraction output
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Mercer committed Aug 31, 2022
1 parent 215c3cb commit 8dc4685
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 6 additions & 3 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.

9 changes: 6 additions & 3 deletions src/analyze-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ function hasBadExpectErrorInput(): boolean {
);
}

// Check for any .trap[.gz] files under the db-go/ folder
function didGolangExtraction(config: Config): boolean {
/**
* Returns whether any `.trap[.gz]` files exist under the `db-go` folder,
* indicating whether Go extraction has extracted at least one file.
*/
function doesGoExtractionOutputExist(config: Config): boolean {
const golangDbDirectory = util.getCodeQLDatabasePath(config, Language.go);
const extractedFiles = fs
.readdirSync(golangDbDirectory)
Expand Down Expand Up @@ -192,7 +195,7 @@ async function run() {
if (
Language.go in config.languages &&
process.env["CODEQL_ACTION_DID_AUTOBUILD_GOLANG"] !== "true" &&
!didGolangExtraction(config)
!doesGoExtractionOutputExist(config)
) {
await runAutobuild(Language.go, config, logger);
}
Expand Down

0 comments on commit 8dc4685

Please sign in to comment.