Fix eject-keycloak-page
This commit is contained in:
@ -19,8 +19,6 @@ import { assert, Equals } from "tsafe/assert";
|
|||||||
import { getThemeSrcDirPath } from "./getSrcDirPath";
|
import { getThemeSrcDirPath } from "./getSrcDirPath";
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const projectDirPath = getProjectRoot();
|
|
||||||
|
|
||||||
console.log("Select a theme type");
|
console.log("Select a theme type");
|
||||||
|
|
||||||
const { value: themeType } = await cliSelect<ThemeType>({
|
const { value: themeType } = await cliSelect<ThemeType>({
|
||||||
@ -51,7 +49,7 @@ import { getThemeSrcDirPath } from "./getSrcDirPath";
|
|||||||
|
|
||||||
const pageBasename = capitalize(kebabCaseToCamelCase(pageId)).replace(/ftl$/, "tsx");
|
const pageBasename = capitalize(kebabCaseToCamelCase(pageId)).replace(/ftl$/, "tsx");
|
||||||
|
|
||||||
const { themeSrcDirPath } = getThemeSrcDirPath({ "projectDirPath": projectDirPath });
|
const { themeSrcDirPath } = getThemeSrcDirPath({ "projectDirPath": process.cwd() });
|
||||||
|
|
||||||
if (themeSrcDirPath === undefined) {
|
if (themeSrcDirPath === undefined) {
|
||||||
throw new Error("Couldn't locate your theme sources");
|
throw new Error("Couldn't locate your theme sources");
|
||||||
@ -65,7 +63,7 @@ import { getThemeSrcDirPath } from "./getSrcDirPath";
|
|||||||
process.exit(-1);
|
process.exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
writeFile(targetFilePath, await readFile(pathJoin(projectDirPath, "src", themeType, "pages", pageBasename)));
|
await writeFile(targetFilePath, await readFile(pathJoin(getProjectRoot(), "src", themeType, "pages", pageBasename)));
|
||||||
|
|
||||||
console.log(`${pathRelative(process.cwd(), targetFilePath)} created`);
|
console.log(`${pathRelative(process.cwd(), targetFilePath)} created`);
|
||||||
})();
|
})();
|
||||||
|
Reference in New Issue
Block a user