MCPcopy
hub / github.com/micro-editor/micro / RunCommand

Function RunCommand

internal/shell/shell.go:35–46  ·  view source on GitHub ↗

RunCommand executes a shell command and returns the output/error

(input string)

Source from the content-addressed store, hash-verified

33
34// RunCommand executes a shell command and returns the output/error
35func RunCommand(input string) (string, error) {
36 args, err := shellquote.Split(input)
37 if err != nil {
38 return "", err
39 }
40 if len(args) == 0 {
41 return "", errors.New("No arguments")
42 }
43 inputCmd := args[0]
44
45 return ExecCommand(inputCmd, args[1:]...)
46}
47
48// RunBackgroundShell runs a shell command in the background
49// It returns a function which will run the command and returns a string

Callers 1

RunBackgroundShellFunction · 0.85

Calls 1

ExecCommandFunction · 0.85

Tested by

no test coverage detected