[feat-76] use "findEntry" instead of a for await loop

This commit is contained in:
MathieuG-P
2024-12-08 18:13:46 +01:00
parent aec9dd0628
commit c3a1a613ff
@@ -349,15 +349,9 @@ export class BsModsManagerService {
const zip = await BsmZipExtractor.fromPath(modPath);
try {
let hasDll = false;
for await (const entry of zip.entries()) {
if (entry.fileName.endsWith(".dll")) {
hasDll = true;
break;
}
}
const dll = await zip.findEntry(entry => entry.fileName.endsWith(".dll"));
if (!hasDll) {
if (!dll) {
log.warn("No \"dll\" found in zip", modPath);
return [];
}