mirror of
https://github.com/delibae/claude-prism.git
synced 2026-08-28 05:14:59 +00:00
refactor(proposed-changes-panel): simplify JSX structure for added/removed indicators refactor(pdf-viewer): format function parameters for better readability fix(project-name): enhance validation for project names to prevent invalid characters refactor(build): improve environment flag handling for better clarity refactor(dev): streamline environment flag appending logic
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
import { spawn } from "node:child_process";
|
|
import { join } from "node:path";
|
|
|
|
const env = { ...process.env };
|
|
|
|
function appendEnvFlag(name, flag) {
|
|
const current = env[name] ?? "";
|
|
env[name] = current.includes(flag)
|
|
? current
|
|
: [current, flag].filter(Boolean).join(" ");
|
|
}
|
|
|
|
if (process.platform === "win32") {
|
|
env.VCPKG_ROOT ||= join(env.USERPROFILE ?? "", "vcpkg");
|
|
env.TECTONIC_DEP_BACKEND = "vcpkg";
|
|
env.VCPKGRS_TRIPLET = "x64-windows-static-release";
|
|
env.VCPKG_DEFAULT_TRIPLET = env.VCPKGRS_TRIPLET;
|
|
appendEnvFlag("RUSTFLAGS", "-Ctarget-feature=+crt-static");
|
|
env.CXXFLAGS = [env.CXXFLAGS, "/std:c++17"].filter(Boolean).join(" ");
|
|
}
|
|
|
|
const child =
|
|
process.platform === "win32"
|
|
? spawn(
|
|
process.env.ComSpec ?? "cmd.exe",
|
|
[
|
|
"/d",
|
|
"/s",
|
|
"/c",
|
|
"corepack pnpm --filter=@claude-prism/desktop tauri dev",
|
|
],
|
|
{
|
|
env,
|
|
stdio: "inherit",
|
|
},
|
|
)
|
|
: spawn("pnpm", ["--filter=@claude-prism/desktop", "tauri", "dev"], {
|
|
env,
|
|
stdio: "inherit",
|
|
});
|
|
|
|
child.on("exit", (code, signal) => {
|
|
if (signal) {
|
|
process.kill(process.pid, signal);
|
|
return;
|
|
}
|
|
|
|
process.exit(code ?? 0);
|
|
});
|