20 lines
734 B
TypeScript
20 lines
734 B
TypeScript
|
||
import { getProjectRoot } from "../bin/tools/getProjectRoot";
|
||
import * as st from "scripting-tools";
|
||
import { join as pathJoin, basename as pathBasename } from "path";
|
||
|
||
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 }));
|
||
|
||
} |