MCPcopy
hub / github.com/air-verse/air / runCommand

Method runCommand

runner/engine.go:616–631  ·  view source on GitHub ↗

utility to execute commands, such as cmd & pre_cmd

(command string)

Source from the content-addressed store, hash-verified

614
615// utility to execute commands, such as cmd & pre_cmd
616func (e *Engine) runCommand(command string) error {
617 cmd, stdout, stderr, err := e.startCmd(command)
618 if err != nil {
619 return err
620 }
621 defer func() {
622 stdout.Close()
623 stderr.Close()
624 }()
625
626 copyOutput(os.Stdout, stdout)
627 copyOutput(os.Stderr, stderr)
628
629 // wait for command to finish
630 return cmd.Wait()
631}
632
633func (e *Engine) runCommandCopyOutput(command string) (string, error) {
634 // both stdout and stderr are piped to the same buffer, so ignore the second

Callers 3

runPreCmdMethod · 0.95
runPostCmdMethod · 0.95
TestRunCommandFunction · 0.95

Calls 2

startCmdMethod · 0.95
copyOutputFunction · 0.85

Tested by 1

TestRunCommandFunction · 0.76