Use a more explicit name for checking Go extraction output

This commit is contained in:
Henry Mercer 2022-08-30 17:57:12 +01:00
parent 215c3cb4bb
commit 8dc468564f
3 changed files with 13 additions and 7 deletions

View file

@ -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)
@ -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);
}