Better prettier params (changelog ignore)
This commit is contained in:
@ -1,15 +1,10 @@
|
||||
import * as fs from "fs";
|
||||
import { join as pathJoin, dirname as pathDirname } from "path";
|
||||
|
||||
export const containerLaunchScriptBasename =
|
||||
"start_keycloak_testing_container.sh";
|
||||
export const containerLaunchScriptBasename = "start_keycloak_testing_container.sh";
|
||||
|
||||
/** Files for being able to run a hot reload keycloak container */
|
||||
export function generateDebugFiles(params: {
|
||||
keycloakVersion: "11.0.3" | "15.0.2";
|
||||
themeName: string;
|
||||
keycloakThemeBuildingDirPath: string;
|
||||
}) {
|
||||
export function generateDebugFiles(params: { keycloakVersion: "11.0.3" | "15.0.2"; themeName: string; keycloakThemeBuildingDirPath: string }) {
|
||||
const { themeName, keycloakThemeBuildingDirPath, keycloakVersion } = params;
|
||||
|
||||
fs.writeFileSync(
|
||||
@ -67,11 +62,7 @@ export function generateDebugFiles(params: {
|
||||
{ "mode": 0o755 },
|
||||
);
|
||||
|
||||
const standaloneHaFilePath = pathJoin(
|
||||
keycloakThemeBuildingDirPath,
|
||||
"configuration",
|
||||
`standalone-ha.xml`,
|
||||
);
|
||||
const standaloneHaFilePath = pathJoin(keycloakThemeBuildingDirPath, "configuration", `standalone-ha.xml`);
|
||||
|
||||
try {
|
||||
fs.mkdirSync(pathDirname(standaloneHaFilePath));
|
||||
@ -80,24 +71,14 @@ export function generateDebugFiles(params: {
|
||||
fs.writeFileSync(
|
||||
standaloneHaFilePath,
|
||||
fs
|
||||
.readFileSync(
|
||||
pathJoin(__dirname, `standalone-ha_${keycloakVersion}.xml`),
|
||||
)
|
||||
.readFileSync(pathJoin(__dirname, `standalone-ha_${keycloakVersion}.xml`))
|
||||
.toString("utf8")
|
||||
.replace(
|
||||
new RegExp(
|
||||
[
|
||||
"<staticMaxAge>2592000</staticMaxAge>",
|
||||
"<cacheThemes>true</cacheThemes>",
|
||||
"<cacheTemplates>true</cacheTemplates>",
|
||||
].join("\\s*"),
|
||||
["<staticMaxAge>2592000</staticMaxAge>", "<cacheThemes>true</cacheThemes>", "<cacheTemplates>true</cacheTemplates>"].join("\\s*"),
|
||||
"g",
|
||||
),
|
||||
[
|
||||
"<staticMaxAge>-1</staticMaxAge>",
|
||||
"<cacheThemes>false</cacheThemes>",
|
||||
"<cacheTemplates>false</cacheTemplates>",
|
||||
].join("\n"),
|
||||
["<staticMaxAge>-1</staticMaxAge>", "<cacheThemes>false</cacheThemes>", "<cacheTemplates>false</cacheTemplates>"].join("\n"),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user