Create symlink to build in keycloak-resource for test env that better reflect prod

This commit is contained in:
Joseph Garrone 2023-11-04 16:29:09 +01:00
parent 1ce666f136
commit 481d93ebc4

View File

@ -45,5 +45,19 @@ import * as fs from "fs";
fs.writeFileSync(pathJoin(keycloakDirInPublicDir, ".gitignore"), Buffer.from("*", "utf8")); fs.writeFileSync(pathJoin(keycloakDirInPublicDir, ".gitignore"), Buffer.from("*", "utf8"));
const buildDirPath = pathJoin(projectDirPath, "build");
if (process.platform === "win32" && !fs.existsSync(buildDirPath)) {
fs.mkdirSync(buildDirPath);
}
try {
fs.symlinkSync(buildDirPath, pathJoin(keycloakDirInPublicDir, "resources", "build"));
} catch (error) {
if (process.platform !== "win32") {
throw error;
}
}
console.log(`${pathRelative(projectDirPath, keycloakDirInPublicDir)} directory created.`); console.log(`${pathRelative(projectDirPath, keycloakDirInPublicDir)} directory created.`);
})(); })();