(command: string)
| 40 | |
| 41 | const exec_ = util.promisify(cp.exec) |
| 42 | const exec = (command: string) => |
| 43 | Effect.andThen( |
| 44 | InfraLogger.logDebug(`Executing: ${command}`), |
| 45 | Effect.tap( |
| 46 | Effect.tryPromise({ |
| 47 | try: () => exec_(command), |
| 48 | catch: (cause) => { |
| 49 | const e = cause as ExecError |
| 50 | return new CUPSError({ |
| 51 | command, |
| 52 | message: e?.message ?? String(cause), |
| 53 | code: e?.code, |
| 54 | signal: e?.signal, |
| 55 | killed: e?.killed, |
| 56 | stdout: e?.stdout, |
| 57 | stderr: e?.stderr, |
| 58 | cause |
| 59 | }) |
| 60 | } |
| 61 | }), |
| 62 | (r) => (InfraLogger.logDebug(`Executed`).pipe(Effect.annotateLogs("result", pretty(r)))) |
| 63 | ) |
| 64 | ) |
| 65 | |
| 66 | type PrinterConfig = { url?: URL | undefined; id: string } |
| 67 |
no test coverage detected
searching dependent graphs…