26 lines
1.0 KiB
TypeScript
Raw Normal View History

import { setupSampleReactProject, sampleReactProjectDirPath } from "./setupSampleReactProject";
2021-02-21 23:06:42 +01:00
import * as st from "scripting-tools";
2023-03-20 01:30:16 +01:00
import * as fs from "fs";
2021-02-21 23:06:42 +01:00
import { join as pathJoin } from "path";
2023-03-18 15:49:45 +01:00
import { getProjectRoot } from "keycloakify/bin/tools/getProjectRoot.js";
2021-02-22 12:11:00 +01:00
2023-03-16 14:39:40 +01:00
(async () => {
2023-03-20 01:48:03 +01:00
fs.rmSync(sampleReactProjectDirPath, { "recursive": true });
2023-03-16 14:39:40 +01:00
await setupSampleReactProject();
2021-02-22 12:11:00 +01:00
2023-03-18 16:57:58 +01:00
const binDirPath = pathJoin(getProjectRoot(), "dist_test", "src", "bin");
2021-03-04 21:43:36 +01:00
2023-03-20 01:30:16 +01:00
fs.mkdirSync(pathJoin(sampleReactProjectDirPath, "src", "keycloak-theme"), { "recursive": true });
st.execSyncTrace(`node ${pathJoin(binDirPath, "initialize-email-theme")}`, { "cwd": sampleReactProjectDirPath });
st.execSyncTrace(`node ${pathJoin(binDirPath, "download-builtin-keycloak-theme")}`, { "cwd": sampleReactProjectDirPath });
2023-03-16 14:39:40 +01:00
st.execSyncTrace(
//`node ${pathJoin(binDirPath, "keycloakify")} --external-assets`,
`node ${pathJoin(binDirPath, "keycloakify")}`,
{ "cwd": sampleReactProjectDirPath }
);
})();