MCPcopy
hub / github.com/perkeep/perkeep / runExec

Function runExec

dev/devcam/devcam.go:57–71  ·  view source on GitHub ↗

runExec execs bin. If the platform doesn't support exec, it runs it and waits for it to finish.

(bin string, args []string, env *Env)

Source from the content-addressed store, hash-verified

55// runExec execs bin. If the platform doesn't support exec, it runs it and waits
56// for it to finish.
57func runExec(bin string, args []string, env *Env) error {
58 if sysExec != nil {
59 sysExec(bin, append([]string{filepath.Base(bin)}, args...), env.Flat())
60 }
61
62 cmd := exec.Command(bin, args...)
63 cmd.Env = env.Flat()
64 cmd.Stdout = os.Stdout
65 cmd.Stderr = os.Stderr
66 if err := cmd.Start(); err != nil {
67 return fmt.Errorf("Could not run %v: %v", bin, err)
68 }
69 go handleSignals(cmd.Process)
70 return cmd.Wait()
71}
72
73// cpDir copies the contents of src dir into dst dir.
74// filter is a list of file suffixes to skip. ex: ".go"

Callers 6

RunCommandMethod · 0.70
RunCommandMethod · 0.70
RunCommandMethod · 0.70
RunCommandMethod · 0.70
runTestsMethod · 0.70
RunCommandMethod · 0.70

Calls 5

FlatMethod · 0.80
WaitMethod · 0.80
handleSignalsFunction · 0.70
CommandMethod · 0.65
StartMethod · 0.65

Tested by

no test coverage detected