Apply the name of the theme in the preconfigured realm
This commit is contained in:
@ -9,7 +9,12 @@ import type { KeycloakVersionRange } from "../shared/KeycloakVersionRange";
|
|||||||
import { getJarFileBasename } from "../shared/getJarFileBasename";
|
import { getJarFileBasename } from "../shared/getJarFileBasename";
|
||||||
import { assert, type Equals } from "tsafe/assert";
|
import { assert, type Equals } from "tsafe/assert";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { join as pathJoin, relative as pathRelative, sep as pathSep } from "path";
|
import {
|
||||||
|
join as pathJoin,
|
||||||
|
relative as pathRelative,
|
||||||
|
sep as pathSep,
|
||||||
|
dirname as pathDirname
|
||||||
|
} from "path";
|
||||||
import * as child_process from "child_process";
|
import * as child_process from "child_process";
|
||||||
import chalk from "chalk";
|
import chalk from "chalk";
|
||||||
import chokidar from "chokidar";
|
import chokidar from "chokidar";
|
||||||
@ -248,6 +253,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const internalFilePath = await (async () => {
|
||||||
const dirPath = pathJoin(
|
const dirPath = pathJoin(
|
||||||
getThisCodebaseRootDirPath(),
|
getThisCodebaseRootDirPath(),
|
||||||
"src",
|
"src",
|
||||||
@ -290,6 +296,29 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
return pathJoin(dirPath, value);
|
return pathJoin(dirPath, value);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
if (internalFilePath === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const filePath = pathJoin(
|
||||||
|
buildContext.cacheDirPath,
|
||||||
|
pathDirname(internalFilePath)
|
||||||
|
);
|
||||||
|
|
||||||
|
fs.writeFileSync(
|
||||||
|
filePath,
|
||||||
|
Buffer.from(
|
||||||
|
fs
|
||||||
|
.readFileSync(internalFilePath)
|
||||||
|
.toString("utf8")
|
||||||
|
.replace(/keycloakify\-starter/g, buildContext.themeNames[0])
|
||||||
|
),
|
||||||
|
"utf8"
|
||||||
|
);
|
||||||
|
|
||||||
|
return filePath;
|
||||||
|
})();
|
||||||
|
|
||||||
const jarFilePath = pathJoin(buildContext.keycloakifyBuildDirPath, jarFileBasename);
|
const jarFilePath = pathJoin(buildContext.keycloakifyBuildDirPath, jarFileBasename);
|
||||||
|
|
||||||
async function extractThemeResourcesFromJar() {
|
async function extractThemeResourcesFromJar() {
|
||||||
|
Reference in New Issue
Block a user