Fix a couple of bug in donwnload-builtin-keycloak-theme
This commit is contained in:
parent
8255ce1158
commit
ae0b059217
@ -182,9 +182,10 @@ export async function downloadBuiltinKeycloakTheme(params: { keycloakVersion: st
|
||||
);
|
||||
}
|
||||
|
||||
// Note, this is an optimization for reducing the size of the jar
|
||||
// Note, this is an optimization for reducing the size of the jar,
|
||||
// For this version we know exactly which resources are used.
|
||||
{
|
||||
const nodeModulesDirPath = pathJoin(destDirPath, "keycloak", "common", "resources");
|
||||
const nodeModulesDirPath = pathJoin(destDirPath, "keycloak", "common", "resources", "node_modules");
|
||||
|
||||
const usedCommonResourceRelativeFilePaths = [
|
||||
...["patternfly.min.css", "patternfly-additions.min.css", "patternfly-additions.min.css"].map(fileBasename =>
|
||||
|
@ -17,13 +17,14 @@ type TransformSourceCode = (params: { sourceCode: Buffer; filePath: string; file
|
||||
* */
|
||||
export function transformCodebase(params: { srcDirPath: string; destDirPath: string; transformSourceCode?: TransformSourceCode }) {
|
||||
const { srcDirPath, transformSourceCode } = params;
|
||||
let { destDirPath } = params;
|
||||
|
||||
const isTargetSameAsSource = path.relative(srcDirPath, destDirPath) === "";
|
||||
const isTargetSameAsSource = path.relative(srcDirPath, params.destDirPath) === "";
|
||||
|
||||
if (isTargetSameAsSource) {
|
||||
destDirPath = path.join(srcDirPath, "..", "tmp_xOsPdkPsTdzPs34sOkHs");
|
||||
}
|
||||
const destDirPath = isTargetSameAsSource ? path.join(srcDirPath, "..", "tmp_xOsPdkPsTdzPs34sOkHs") : params.destDirPath;
|
||||
|
||||
fs.mkdirSync(destDirPath, {
|
||||
"recursive": true
|
||||
});
|
||||
|
||||
for (const fileRelativePath of crawl({ "dirPath": srcDirPath, "returnedPathsType": "relative to dirPath" })) {
|
||||
const filePath = path.join(srcDirPath, fileRelativePath);
|
||||
|
Loading…
x
Reference in New Issue
Block a user