keycloak_theme/scripts/link-in-starter.ts

31 lines
854 B
TypeScript
Raw Normal View History

import * as child_process from "child_process";
import * as fs from "fs";
import { join } from "path";
import { startRebuildOnSrcChange } from "./startRebuildOnSrcChange";
2024-05-20 15:48:51 +02:00
fs.rmSync("node_modules", { recursive: true, force: true });
fs.rmSync("dist", { recursive: true, force: true });
fs.rmSync(".yarn_home", { recursive: true, force: true });
run("yarn install");
run("yarn build");
const starterName = "keycloakify-starter-webpack";
fs.rmSync(join("..", starterName, "node_modules"), {
2024-05-20 15:48:51 +02:00
recursive: true,
force: true
});
run("yarn install", { cwd: join("..", starterName) });
run(`npx tsx ${join("scripts", "link-in-app.ts")} ${starterName}`);
startRebuildOnSrcChange();
function run(command: string, options?: { cwd: string }) {
console.log(`$ ${command}`);
2024-05-20 15:48:51 +02:00
child_process.execSync(command, { stdio: "inherit", ...options });
}