MCPcopy Create free account
hub / github.com/chakra-ui/panda / runCommand

Function runCommand

sandbox/codegen/cli.ts:29–46  ·  view source on GitHub ↗
(command: string, envVars = {})

Source from the content-addressed store, hash-verified

27}
28
29const runCommand = (command: string, envVars = {}) => {
30 return new Promise((resolve, reject) => {
31 const [cmd, ...args] = command.split(' ')
32 const proc = spawn(cmd, args, {
33 env: { ...process.env, ...envVars },
34 stdio: 'inherit',
35 })
36
37 proc.on('close', (code) => {
38 if (code !== 0) {
39 console.error(`Command failed with exit code ${code}`)
40 reject()
41 return
42 }
43 resolve(0)
44 })
45 })
46}
47
48cli.command('').action(() => {
49 return cli.outputHelp()

Callers 1

cli.tsFile · 0.70

Calls 2

onMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected