(opts: StartDaemonForegroundOptions)
| 239 | * Used for debugging. The function returns when the daemon exits. |
| 240 | */ |
| 241 | export function startDaemonForeground(opts: StartDaemonForegroundOptions): Promise<number> { |
| 242 | const daemonPath = getDaemonExecutablePath(); |
| 243 | |
| 244 | return new Promise<number>((resolve) => { |
| 245 | const child = spawn(process.execPath, [daemonPath], { |
| 246 | stdio: 'inherit', |
| 247 | cwd: opts.workspaceRoot, |
| 248 | env: { |
| 249 | ...process.env, |
| 250 | ...opts.env, |
| 251 | XCODEBUILDMCP_SOCKET: opts.socketPath, |
| 252 | XCODEBUILDCLI_SOCKET: opts.socketPath, |
| 253 | }, |
| 254 | }); |
| 255 | |
| 256 | child.on('exit', (code) => { |
| 257 | resolve(code ?? 0); |
| 258 | }); |
| 259 | }); |
| 260 | } |
no test coverage detected