MCPcopy Create free account
hub / github.com/porsager/postgres / exec

Function exec

deno/tests/bootstrap.js:27–34  ·  view source on GitHub ↗
(cmd, args)

Source from the content-addressed store, hash-verified

25}
26
27export async function exec(cmd, args) { // eslint-disable-line
28 let stderr = ''
29 const cp = await spawn(cmd, args, { stdio: 'pipe', encoding: 'utf8' }) // eslint-disable-line
30 cp.stderr.on('data', x => stderr += x)
31 await new Promise(x => cp.on('exit', x))
32 if (stderr && !stderr.includes('already exists') && !stderr.includes('does not exist'))
33 throw new Error(stderr)
34}

Callers 2

index.jsFile · 0.90
bootstrap.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected