Fix bugs in manifest grouping

This commit is contained in:
Justin Hutchings
2023-01-22 08:28:57 +00:00
parent ffa1f4043a
commit 7cf27a1e9d
3 changed files with 5 additions and 7 deletions
+2 -3
View File
@@ -48,7 +48,6 @@ export default class ComponentDetection {
core.info("Running component-detection");
try {
await exec.exec(`ls -la`);
await exec.exec(`${this.componentDetectionPath} scan --SourceDirectory ${path} --ManifestFile ${this.outputPath}`);
} catch (error: any) {
core.error(error);
@@ -97,9 +96,9 @@ export default class ComponentDetection {
manifests.push(manifest);
}
if (pkg.topLevelReferrers.length == 0) {
manifests.find((manifest: Manifest) => manifest.file == location.filePath)?.addDirectDependency(pkg, ComponentDetection.getDependencyScope(pkg));
manifests.find((manifest: Manifest) => manifest.name == location)?.addDirectDependency(pkg, ComponentDetection.getDependencyScope(pkg));
} else {
manifests.find((manifest: Manifest) => manifest.file == location.filePath)?.addIndirectDependency(pkg, ComponentDetection.getDependencyScope(pkg)); }
manifests.find((manifest: Manifest) => manifest.name == location)?.addIndirectDependency(pkg, ComponentDetection.getDependencyScope(pkg)); }
});
});
return manifests;
Generated Vendored
+2 -3
View File
@@ -23772,7 +23772,6 @@ class ComponentDetection {
return __awaiter(this, void 0, void 0, function* () {
core.info("Running component-detection");
try {
yield exec.exec(`ls -la`);
yield exec.exec(`${this.componentDetectionPath} scan --SourceDirectory ${path} --ManifestFile ${this.outputPath}`);
}
catch (error) {
@@ -23817,10 +23816,10 @@ class ComponentDetection {
manifests.push(manifest);
}
if (pkg.topLevelReferrers.length == 0) {
(_a = manifests.find((manifest) => manifest.file == location.filePath)) === null || _a === void 0 ? void 0 : _a.addDirectDependency(pkg, ComponentDetection.getDependencyScope(pkg));
(_a = manifests.find((manifest) => manifest.name == location)) === null || _a === void 0 ? void 0 : _a.addDirectDependency(pkg, ComponentDetection.getDependencyScope(pkg));
}
else {
(_b = manifests.find((manifest) => manifest.file == location.filePath)) === null || _b === void 0 ? void 0 : _b.addIndirectDependency(pkg, ComponentDetection.getDependencyScope(pkg));
(_b = manifests.find((manifest) => manifest.name == location)) === null || _b === void 0 ? void 0 : _b.addIndirectDependency(pkg, ComponentDetection.getDependencyScope(pkg));
}
}));
}));
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long