Skip to content

Commit bdfe2f6

Browse files
committed
Move error count outside scope
1 parent 8e33d30 commit bdfe2f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sbomCollector.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ export class SbomCollector {
310310
continue;
311311
}
312312

313-
if (this.opts.lightDelayMs) await new Promise(r => setTimeout(r, this.opts.lightDelayMs));
314313
const base = this.opts.branchDiffBase || sbom?.defaultBranch;
315314
if (!base) { console.error(chalk.red(`Cannot compute branch diff for ${fullName} branch ${b.name} because base branch is undefined.`)); continue; }
315+
316316
if (this.opts.lightDelayMs) await new Promise(r => setTimeout(r, this.opts.lightDelayMs));
317317
// Optionally perform dependency submission up front for the branch
318318
if (this.opts.forceSubmission) {
@@ -334,7 +334,9 @@ export class SbomCollector {
334334
this.decisions[fullName] = (this.decisions[fullName] || "") + ` (branch scan error: ${(e as Error).message})`;
335335
console.debug((e as Error).message);
336336
}
337+
337338
if (sbom.error) this.summary.failedCount++; else this.summary.successCount++;
339+
338340
// Write freshly fetched SBOM immediately if a cache directory is configured
339341
if (this.opts.loadFromDir && this.opts.syncSboms && this.opts.loadFromDir.length) {
340342
try { writeOne(sbom, { outDir: this.opts.loadFromDir }); } catch { /* ignore write errors */ }

0 commit comments

Comments
 (0)