From e78eafd1f1cf7a1e585ea26e26abf114fa01a221 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Sun, 17 Nov 2024 20:53:38 +0100 Subject: [PATCH] Fix --- src/bin/postinstall/uiModuleMeta.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/bin/postinstall/uiModuleMeta.ts b/src/bin/postinstall/uiModuleMeta.ts index 8ad49514..1416d8df 100644 --- a/src/bin/postinstall/uiModuleMeta.ts +++ b/src/bin/postinstall/uiModuleMeta.ts @@ -16,6 +16,7 @@ import { } from "./getUiModuleFileSourceCodeReadyToBeCopied"; import * as crypto from "crypto"; import { KEYCLOAK_THEME } from "../shared/constants"; +import { exclude } from "tsafe/exclude"; export type UiModuleMeta = { moduleName: string; @@ -113,11 +114,16 @@ export async function getUiModuleMetas(params: { moduleName.includes("keycloakify") && moduleName !== "keycloakify" }); - return Promise.all( - installedModulesWithKeycloakifyInTheName.filter(async ({ dirPath }) => - existsAsync(pathJoin(dirPath, KEYCLOAK_THEME)) + return ( + await Promise.all( + installedModulesWithKeycloakifyInTheName.map(async entry => { + if (!(await existsAsync(pathJoin(entry.dirPath, KEYCLOAK_THEME)))) { + return undefined; + } + return entry; + }) ) - ); + ).filter(exclude(undefined)); })(); const cacheContent = await (async () => {