MCPcopy Create free account
hub / github.com/barnybug/cli53 / execute

Function execute

internal/features/step_definitions.go:202–214  ·  view source on GitHub ↗
(cmd string, env ...string)

Source from the content-addressed store, hash-verified

200}
201
202func execute(cmd string, env ...string) {
203 args := safeSplit(cmd)
204 ps := exec.Command("./"+args[0], args[1:]...)
205 ps.Env = append(os.Environ(), env...)
206 out, err := ps.CombinedOutput()
207 runOutput = string(out)
208 if err, ok := err.(*exec.ExitError); ok {
209 waitStatus := err.Sys().(syscall.WaitStatus)
210 retCode = waitStatus.ExitStatus()
211 } else if err != nil {
212 T.Errorf("Error: %s Output: %s", err, out)
213 }
214}
215
216func init() {
217 Before("", func() {

Callers 1

initFunction · 0.85

Calls 1

safeSplitFunction · 0.85

Tested by

no test coverage detected