MCPcopy Create free account
hub / github.com/effect-app/libs / exec

Function exec

packages/infra/src/CUPS.ts:42–64  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

40
41const exec_ = util.promisify(cp.exec)
42const 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
66type PrinterConfig = { url?: URL | undefined; id: string }
67

Callers 3

printFile_Function · 0.70
CUPS.tsFile · 0.70
CommanderImplClass · 0.50

Calls 3

prettyFunction · 0.90
pipeMethod · 0.65
StringInterface · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…