MCPcopy Create free account
hub / github.com/cloudwan/gohan / execCommand

Function execCommand

cli/generate.go:195–205  ·  view source on GitHub ↗
(command string)

Source from the content-addressed store, hash-verified

193}
194
195func execCommand(command string) {
196 output, err := exec.Command("sh", "-c", command).Output()
197 log.Info("Running: %s", command)
198 outputStr := string(output[:])
199 if outputStr != "" {
200 log.Info("Output: %s", outputStr)
201 }
202 if err != nil {
203 log.Error("Error: %s %s", err, output)
204 }
205}

Callers 1

gohanGenerateFunction · 0.85

Calls 3

InfoMethod · 0.65
ErrorMethod · 0.65
CommandMethod · 0.45

Tested by

no test coverage detected