Don't over factorize

This commit is contained in:
Joseph Garrone 2024-05-17 01:01:58 +02:00
parent 7d61be231e
commit fb44700dd5

View File

@ -33,16 +33,14 @@ export async function buildJar(params: {
rmSync(keycloakifyBuildTmpDirPath, { "recursive": true, "force": true }); rmSync(keycloakifyBuildTmpDirPath, { "recursive": true, "force": true });
const srcMainResourcesRelativeDirPath = pathJoin("src", "main", "resources");
{ {
const keycloakThemesJsonFilePath = pathJoin(srcMainResourcesRelativeDirPath, "META-INF", "keycloak-themes.json"); const keycloakThemesJsonFilePath = pathJoin("src", "main", "resources", "META-INF", "keycloak-themes.json");
const themePropertiesFilePathSet = new Set( const themePropertiesFilePathSet = new Set(
...buildOptions.themeNames.map(themeName => pathJoin(srcMainResourcesRelativeDirPath, "theme", themeName, "account", "theme.properties")) ...buildOptions.themeNames.map(themeName => pathJoin("src", "main", "resources", "theme", themeName, "account", "theme.properties"))
); );
const accountV1RelativeDirPath = pathJoin(srcMainResourcesRelativeDirPath, "theme", accountV1ThemeName); const accountV1RelativeDirPath = pathJoin("src", "main", "resources", "theme", accountV1ThemeName);
transformCodebase({ transformCodebase({
"srcDirPath": buildOptions.keycloakifyBuildDirPath, "srcDirPath": buildOptions.keycloakifyBuildDirPath,
@ -104,7 +102,7 @@ export async function buildJar(params: {
(["register.ftl", "login-update-profile.ftl"] as const).forEach(pageId => (["register.ftl", "login-update-profile.ftl"] as const).forEach(pageId =>
buildOptions.themeNames.map(themeName => { buildOptions.themeNames.map(themeName => {
const ftlFilePath = pathJoin(keycloakifyBuildTmpDirPath, srcMainResourcesRelativeDirPath, "theme", themeName, "login", pageId); const ftlFilePath = pathJoin(keycloakifyBuildTmpDirPath, "src", "main", "resources", "theme", themeName, "login", pageId);
const ftlFileContent = readFileSync(ftlFilePath).toString("utf8"); const ftlFileContent = readFileSync(ftlFilePath).toString("utf8");