brain / tui /scripts /sync-install-extras.mjs
Leon4gr45's picture
Upload folder using huggingface_hub (part 4)
ac68ae4 verified
Raw History Blame Contribute Delete
881 Bytes
#!/usr/bin/env node
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const here = dirname(fileURLToPath(import.meta.url));
const repoRoot = resolve(here, "..", "..");
const sourcePath = resolve(repoRoot, "scripts", "install_extras.py");
const targetPath = resolve(here, "..", "src", "embedded", "install-extras-script.ts");
const script = readFileSync(sourcePath, "utf8");
mkdirSync(dirname(targetPath), { recursive: true });
const out = `// Auto-generated from scripts/install_extras.py — do not edit by hand.
// Regenerate with: npm run sync:install-extras (also runs as prebuild).
export const INSTALL_EXTRAS_SCRIPT = ${JSON.stringify(script)};
`;
writeFileSync(targetPath, out, "utf8");
console.log(`Synced ${sourcePath} → ${targetPath} (${script.length} bytes)`);