File size: 881 Bytes
ac68ae4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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)`);