fix build

This commit is contained in:
Joseph Garrone
2021-03-03 02:31:02 +01:00
parent 52ba14cd8f
commit 2a5a4c16ea
8 changed files with 70 additions and 65 deletions

View File

@ -1,24 +1,18 @@
import {
setupSampleReactProject,
setupSampleReactProject,
sampleReactProjectDirPath
} from "./setupSampleReactProject";
import * as st from "scripting-tools";
import { join as pathJoin } from "path";
import { getProjectRoot } from "../bin/tools/getProjectRoot";
import { getProjectRoot } from "../bin/tools/getProjectRoot";
setupSampleReactProject();
console.log(`Running main in ${sampleReactProjectDirPath}`);
console.log(
st.execSync(
`node ${pathJoin(getProjectRoot(), "dist", "bin", "build-keycloak-theme")}`,
{ "cwd": sampleReactProjectDirPath }
)
);
st.execSyncTrace(
`node ${pathJoin(getProjectRoot(), "dist", "bin", "build-keycloak-theme")}`,
{ "cwd": sampleReactProjectDirPath }
)

View File

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

View File

@ -1,20 +1,14 @@
import { getProjectRoot } from "../bin/tools/getProjectRoot";
import * as st from "scripting-tools";
import { join as pathJoin, basename as pathBasename } from "path";
import { getProjectRoot } from "../bin/tools/getProjectRoot";
import { join as pathJoin } from "path";
import { downloadAndUnzip } from "../bin/tools/downloadAndUnzip";
export const sampleReactProjectDirPath = pathJoin(getProjectRoot(), "sample_react_project");
export function setupSampleReactProject() {
st.execSync(`rm -rf ${sampleReactProjectDirPath}`);
st.execSync(`mkdir ${sampleReactProjectDirPath}`);
const url = "https://github.com/garronej/keycloak-react-theming/releases/download/v0.0.1/sample_build_dir_and_package_json.zip";
[
`wget ${url}`,
...["unzip", "rm"].map(prg => `${prg} ${pathBasename(url)}`)
].forEach(cmd => st.execSync(cmd, { "cwd": sampleReactProjectDirPath }));
}
downloadAndUnzip({
"url": "https://github.com/garronej/keycloak-react-theming/releases/download/v0.0.1/sample_build_dir_and_package_json.zip",
"destDirPath": sampleReactProjectDirPath
});
}