(
command: ChildProcess.StandardCommand,
proc: NodeChildProcess.ChildProcess,
cfg: ChildProcess.StdinConfig,
)
| 221 | }) |
| 222 | |
| 223 | const setupStdin = ( |
| 224 | command: ChildProcess.StandardCommand, |
| 225 | proc: NodeChildProcess.ChildProcess, |
| 226 | cfg: ChildProcess.StdinConfig, |
| 227 | ) => |
| 228 | Effect.suspend(() => { |
| 229 | let sink: Sink.Sink<void, unknown, never, PlatformError.PlatformError> = Sink.drain |
| 230 | if (Predicate.isNotNull(proc.stdin)) { |
| 231 | sink = NodeSink.fromWritable({ |
| 232 | evaluate: () => proc.stdin!, |
| 233 | onError: (err) => toPlatformError("fromWritable(stdin)", toError(err), command), |
| 234 | endOnDone: cfg.endOnDone, |
| 235 | encoding: cfg.encoding, |
| 236 | }) |
| 237 | } |
| 238 | if (Stream.isStream(cfg.stream)) return Effect.as(Effect.forkScoped(Stream.run(cfg.stream, sink)), sink) |
| 239 | return Effect.succeed(sink) |
| 240 | }) |
| 241 | |
| 242 | const setupOutput = ( |
| 243 | command: ChildProcess.StandardCommand, |
no test coverage detected