* Returns the args that must precede CLI flags when spawning a child claude * process. In compiled binaries, process.execPath is the claude binary itself * and args go directly to it. In npm installs (node running cli.js), * process.execPath is the node runtime — the child spawn must pass the scr
()
| 117 | * and exits with "bad option: --sdk-url". See anthropics/claude-code#28334. |
| 118 | */ |
| 119 | function spawnScriptArgs(): string[] { |
| 120 | if (isInBundledMode() || !process.argv[1]) { |
| 121 | return [] |
| 122 | } |
| 123 | return [process.argv[1]] |
| 124 | } |
| 125 | |
| 126 | /** Attempt to spawn a session; returns error string if spawn throws. */ |
| 127 | function safeSpawn( |
no test coverage detected