support homepage with urlPath

This commit is contained in:
Joseph Garrone
2021-03-22 19:40:38 +01:00
parent 0cc02c292f
commit 1cb5dd461b
6 changed files with 40 additions and 18 deletions

View File

@ -6,6 +6,7 @@ import type { ParsedPackageJson } from "./generateJavaStackFiles";
import { join as pathJoin, relative as pathRelative, basename as pathBasename } from "path";
import * as child_process from "child_process";
import { generateDebugFiles, containerLaunchScriptBasename } from "./generateDebugFiles";
import { URL } from "url";
const reactProjectDirPath = process.cwd();
@ -22,7 +23,16 @@ if (require.main === module) {
generateKeycloakThemeResources({
keycloakThemeBuildingDirPath,
"reactAppBuildDirPath": pathJoin(reactProjectDirPath, "build"),
"themeName": parsedPackageJson.name
"themeName": parsedPackageJson.name,
"urlPathname": (()=>{
const { homepage } = parsedPackageJson;
return homepage === undefined ?
"/" :
new URL(homepage).pathname.replace(/([^/])$/, "$1/");
})()
});
const { jarFilePath } = generateJavaStackFiles({