File size: 751 Bytes
cd8bd0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env node
/**
 * Post-install warm-up for OmniRoute native runtimes.
 *
 * Runs after the main `scripts/build/postinstall.mjs` binary-copy step.
 * Tries to pre-resolve better-sqlite3 into ~/.omniroute/runtime/ so that
 * the first execution is fast and EBUSY-resilient on Windows.
 *
 * Non-fatal: any error is printed as a warning and install continues.
 */

if (
  process.env.OMNIROUTE_SKIP_POSTINSTALL === "1" ||
  process.env.CI === "true" ||
  process.env.CI === "1"
) {
  process.exit(0);
}

(async () => {
  try {
    const { warmUpRuntimes } = await import("../bin/cli/runtime/index.mjs");
    await warmUpRuntimes();
  } catch (err) {
    console.warn(`[omniroute] postinstall warm-up skipped: ${err?.message ?? err}`);
  }
})();