Add script for downloading base themes

This commit is contained in:
Joseph Garrone
2021-02-21 23:06:42 +01:00
parent 6ef4348c99
commit 0d5462d2f1
8 changed files with 90 additions and 42 deletions

View File

@ -1,11 +1,15 @@
import { setupSampleReactProject } from "./setupSampleReactProject";
import * as st from "scripting-tools";
import { join as pathJoin } from "path";
const { sampleReactProjectDirPath } = setupSampleReactProject();
process.chdir(sampleReactProjectDirPath);
console.log(`Running main in ${sampleReactProjectDirPath}`);
import("../bin/build-keycloak-theme");
st.execSync(
`node ${pathJoin(__dirname, "../bin/build-keycloak-theme")}`,
{ "cwd": sampleReactProjectDirPath }
);

View File

@ -0,0 +1,13 @@
import { sampleReactProjectDirPath } from "./setupSampleReactProject";
import * as st from "scripting-tools";
import { join as pathJoin } from "path";
console.log(`Running main in ${sampleReactProjectDirPath}`);
st.execSync(
`node ${pathJoin(__dirname, "../bin/download-sample-keycloak-themes")}`,
{ "cwd": sampleReactProjectDirPath }
);

View File

@ -2,9 +2,9 @@
import * as st from "scripting-tools";
import { join as pathJoin, basename as pathBasename } from "path";
export function setupSampleReactProject() {
export const sampleReactProjectDirPath = pathJoin(__dirname, "..", "..", "sample_react_project");
const sampleReactProjectDirPath = pathJoin(__dirname, "..", "..", "sample_react_project");
export function setupSampleReactProject() {
st.execSync(`rm -rf ${sampleReactProjectDirPath}`);
st.execSync(`mkdir ${sampleReactProjectDirPath}`);