Simplify doesGoExtractionOutputExist implementation
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
This commit is contained in:
parent
fff56ee004
commit
e466e75875
3 changed files with 11 additions and 19 deletions
8
lib/analyze-action.js
generated
8
lib/analyze-action.js
generated
|
|
@ -77,13 +77,9 @@ function hasBadExpectErrorInput() {
|
|||
*/
|
||||
function doesGoExtractionOutputExist(config) {
|
||||
const golangDbDirectory = util.getCodeQLDatabasePath(config, languages_1.Language.go);
|
||||
const extractedFiles = fs
|
||||
return fs
|
||||
.readdirSync(golangDbDirectory)
|
||||
.filter((fileName) => fileName.endsWith(".trap") || fileName.endsWith(".trap.gz"));
|
||||
if (extractedFiles.length !== 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
.some((fileName) => fileName.endsWith(".trap") || fileName.endsWith(".trap.gz"));
|
||||
}
|
||||
async function run() {
|
||||
const startedAt = new Date();
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -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. */
|
||||
|
|
@ -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 || {}),
|
||||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue