Almoste there
This commit is contained in:
@ -1,24 +1,13 @@
|
||||
|
||||
import * as st from "scripting-tools";
|
||||
import { join as pathJoin } from "path";
|
||||
import { generateKeycloakThemeResources } from "../bin/generateKeycloakThemeResources";
|
||||
import { setupSampleReactProject } from "./setupSampleReactProject";
|
||||
|
||||
const cwd= pathJoin(__dirname, "..", "..", "etc_tmp");
|
||||
|
||||
st.execSync(`rm -rf ${cwd}`);
|
||||
st.execSync(`mkdir ${cwd}`);
|
||||
|
||||
process.chdir(cwd);
|
||||
|
||||
st.execSync("wget https://github.com/garronej/keycloak-react-theming/releases/download/v0.0.1/build.zip");
|
||||
|
||||
st.execSync("unzip build.zip");
|
||||
|
||||
st.execSync("rm build.zip");
|
||||
const { sampleReactProjectDirPath } = setupSampleReactProject();
|
||||
|
||||
generateKeycloakThemeResources({
|
||||
"themeName": "onyxia-ui",
|
||||
"reactAppBuildDirPath": pathJoin(process.cwd(), "build"),
|
||||
"keycloakThemeBuildingDirPath": pathJoin(process.cwd(), "keycloak_build")
|
||||
"reactAppBuildDirPath": pathJoin(sampleReactProjectDirPath, "build"),
|
||||
"keycloakThemeBuildingDirPath": pathJoin(sampleReactProjectDirPath, "build_keycloak_theme")
|
||||
});
|
||||
|
||||
|
11
src/test/main.ts
Normal file
11
src/test/main.ts
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
import { setupSampleReactProject } from "./setupSampleReactProject";
|
||||
|
||||
const { sampleReactProjectDirPath } = setupSampleReactProject();
|
||||
|
||||
process.chdir(sampleReactProjectDirPath);
|
||||
|
||||
console.log(`Running main in ${sampleReactProjectDirPath}`);
|
||||
|
||||
import("../bin/main");
|
||||
|
20
src/test/setupSampleReactProject.ts
Normal file
20
src/test/setupSampleReactProject.ts
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
import * as st from "scripting-tools";
|
||||
import { join as pathJoin } from "path";
|
||||
|
||||
export function setupSampleReactProject() {
|
||||
|
||||
const sampleReactProjectDirPath = pathJoin(__dirname, "..", "..", "sample_react_project");
|
||||
|
||||
st.execSync(`rm -rf ${sampleReactProjectDirPath}`);
|
||||
st.execSync(`mkdir ${sampleReactProjectDirPath}`);
|
||||
|
||||
[
|
||||
"wget https://github.com/garronej/keycloak-react-theming/releases/download/v0.0.1/sample_build_dir_and_package_json.zip",
|
||||
"unzip build.zip",
|
||||
"rm build.zip"
|
||||
].forEach(cmd => st.execSync(cmd, { "cwd": sampleReactProjectDirPath }));
|
||||
|
||||
return { sampleReactProjectDirPath };
|
||||
|
||||
}
|
Reference in New Issue
Block a user