The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | // @effect-diagnostics nodeBuiltinImport:off |
| 2 | import * as NodeURL from "node:url"; |
| 3 | |
| 4 | export function vitePlusCommand( |
| 5 | args: ReadonlyArray<string>, |
| 6 | // oxlint-disable-next-line t3code/no-global-process-runtime -- Standalone Node tooling has no Effect runtime; tests pass the platform explicitly. |
| 7 | platform: NodeJS.Platform = process.platform, |
| 8 | ): [command: string, args: Array<string>] { |
| 9 | // Windows cannot spawn the package manager's vp.cmd shim without a shell. |
| 10 | // Use Vite+'s exported JS entry with this Node instead, keeping paths and |
| 11 | // arguments literal. Resolve here, not from the patch check's temporary cwd. |
| 12 | if (platform === "win32") { |
| 13 | return [ |
| 14 | process.execPath, |
| 15 | [NodeURL.fileURLToPath(import.meta.resolve("vite-plus/bin")), ...args], |
| 16 | ]; |
| 17 | } |
| 18 | return ["vp", [...args]]; |
| 19 | } |