| 1 | import type * as ChildProcess from "effect/process/ChildProcess" |
| 2 | import type * as NodeChildProcess from "node:child_process" |
| 3 | |
| 4 | export const buildSpawnOptions = ( |
| 5 | options: ChildProcess.CommandOptions, |
| 6 | base: Pick<NodeChildProcess.SpawnOptions, "cwd" | "env" | "stdio">, |
| 7 | platform: NodeJS.Platform |
| 8 | ): NodeChildProcess.SpawnOptions => { |
| 9 | const detached = options.detached ?? platform !== "win32" |
| 10 | return { |
| 11 | ...base, |
| 12 | detached, |
| 13 | shell: options.shell, |
| 14 | windowsHide: options.windowsHide ?? !detached |
| 15 | } |
| 16 | } |