From b6cc3ee0228c604b50fe6855f091d1bf78322c83 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Sat, 18 May 2024 04:48:04 +0200 Subject: [PATCH] Create the .gitignore first --- src/bin/shared/copyKeycloakResourcesToPublic.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bin/shared/copyKeycloakResourcesToPublic.ts b/src/bin/shared/copyKeycloakResourcesToPublic.ts index 2037fa3e..baff23d9 100644 --- a/src/bin/shared/copyKeycloakResourcesToPublic.ts +++ b/src/bin/shared/copyKeycloakResourcesToPublic.ts @@ -54,6 +54,10 @@ export async function copyKeycloakResourcesToPublic(params: { buildOptions: Buil rmSync(destDirPath, { "force": true, "recursive": true }); + fs.mkdirSync(destDirPath, { "recursive": true }); + + fs.writeFileSync(pathJoin(destDirPath, ".gitignore"), Buffer.from("*", "utf8")); + for (const themeType of themeTypes) { await downloadKeycloakStaticResources({ "keycloakVersion": (() => { @@ -76,12 +80,11 @@ export async function copyKeycloakResourcesToPublic(params: { buildOptions: Buil // prettier-ignore [ "This is just a test folder that helps develop", - "the login and register page without having to run a Keycloak container" + "the login and register page without having to run a Keycloak container\n", + "This directory will be automatically excluded from the final build." ].join(" ") ) ); - fs.writeFileSync(pathJoin(buildOptions.publicDirPath, keycloak_resources, ".gitignore"), Buffer.from("*", "utf8")); - fs.writeFileSync(keycloakifyBuildinfoFilePath, Buffer.from(keycloakifyBuildinfoRaw, "utf8")); }