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) {
|
function doesGoExtractionOutputExist(config) {
|
||||||
const golangDbDirectory = util.getCodeQLDatabasePath(config, languages_1.Language.go);
|
const golangDbDirectory = util.getCodeQLDatabasePath(config, languages_1.Language.go);
|
||||||
const extractedFiles = fs
|
return fs
|
||||||
.readdirSync(golangDbDirectory)
|
.readdirSync(golangDbDirectory)
|
||||||
.filter((fileName) => fileName.endsWith(".trap") || fileName.endsWith(".trap.gz"));
|
.some((fileName) => fileName.endsWith(".trap") || fileName.endsWith(".trap.gz"));
|
||||||
if (extractedFiles.length !== 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
async function run() {
|
async function run() {
|
||||||
const startedAt = new Date();
|
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
|
interface AnalysisStatusReport
|
||||||
extends upload_lib.UploadStatusReport,
|
extends upload_lib.UploadStatusReport,
|
||||||
QueriesStatusReport {}
|
QueriesStatusReport { }
|
||||||
|
|
||||||
interface FinishStatusReport
|
interface FinishStatusReport
|
||||||
extends actionsUtil.StatusReportBase,
|
extends actionsUtil.StatusReportBase,
|
||||||
actionsUtil.DatabaseCreationTimings,
|
actionsUtil.DatabaseCreationTimings,
|
||||||
AnalysisStatusReport {}
|
AnalysisStatusReport { }
|
||||||
|
|
||||||
interface FinishWithTrapUploadStatusReport extends FinishStatusReport {
|
interface FinishWithTrapUploadStatusReport extends FinishStatusReport {
|
||||||
/** Size of TRAP caches that we uploaded, in bytes. */
|
/** Size of TRAP caches that we uploaded, in bytes. */
|
||||||
|
|
@ -71,9 +71,9 @@ export async function sendStatusReport(
|
||||||
...statusReportBase,
|
...statusReportBase,
|
||||||
...(config
|
...(config
|
||||||
? {
|
? {
|
||||||
ml_powered_javascript_queries:
|
ml_powered_javascript_queries:
|
||||||
util.getMlPoweredJsQueriesStatus(config),
|
util.getMlPoweredJsQueriesStatus(config),
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
...(stats || {}),
|
...(stats || {}),
|
||||||
...(dbCreationTimings || {}),
|
...(dbCreationTimings || {}),
|
||||||
|
|
@ -106,15 +106,11 @@ function hasBadExpectErrorInput(): boolean {
|
||||||
*/
|
*/
|
||||||
function doesGoExtractionOutputExist(config: Config): boolean {
|
function doesGoExtractionOutputExist(config: Config): boolean {
|
||||||
const golangDbDirectory = util.getCodeQLDatabasePath(config, Language.go);
|
const golangDbDirectory = util.getCodeQLDatabasePath(config, Language.go);
|
||||||
const extractedFiles = fs
|
return fs
|
||||||
.readdirSync(golangDbDirectory)
|
.readdirSync(golangDbDirectory)
|
||||||
.filter(
|
.some(
|
||||||
(fileName) => fileName.endsWith(".trap") || fileName.endsWith(".trap.gz")
|
(fileName) => fileName.endsWith(".trap") || fileName.endsWith(".trap.gz")
|
||||||
);
|
);
|
||||||
if (extractedFiles.length !== 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue