-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsplice.ts
More file actions
executable file
·25 lines (24 loc) · 822 Bytes
/
splice.ts
File metadata and controls
executable file
·25 lines (24 loc) · 822 Bytes
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
#!/usr/bin/env -S tsx
/**
* Thin forwarder to the modular CLI.
* This ensures `npx tsx splice.ts` runs the latest CLI (including checkpoints).
*
* In dev: loads TypeScript entry at src/cli/splice.ts
* In build: falls back to compiled dist/cli/splice.js
*/
try {
// Prefer TypeScript entry during development
await import("./src/cli/splice.ts");
} catch (errTs) {
try {
// Fallback to compiled JavaScript entry after build
await import("./dist/cli/splice.js");
} catch (errJs) {
const msgTs = (errTs && (errTs as Error).message) || String(errTs);
const msgJs = (errJs && (errJs as Error).message) || String(errJs);
console.error("[error] Failed to load CLI entry.");
console.error(" TS entry error:", msgTs);
console.error(" JS entry error:", msgJs);
process.exit(1);
}
}