MCPcopy Index your code
hub / github.com/cortesi/modd / makeCommand

Function makeCommand

shell/shell.go:201–218  ·  view source on GitHub ↗
(shell string, command string, dir string)

Source from the content-addressed store, hash-verified

199}
200
201func makeCommand(shell string, command string, dir string) (*exec.Cmd, error) {
202 shcmd, err := CheckShell(shell)
203 if err != nil {
204 return nil, err
205 }
206 var cmd *exec.Cmd
207 switch shell {
208 case "bash", "sh":
209 cmd = exec.Command(shcmd, "-c", command)
210 case "modd":
211 cmd = exec.Command(shcmd, "--exec", command)
212 case "powershell":
213 cmd = exec.Command(shcmd, "-Command", command)
214 }
215 cmd.Dir = dir
216 prepCmd(cmd)
217 return cmd, nil
218}

Callers 2

NewExecutorFunction · 0.85
startMethod · 0.85

Calls 2

CheckShellFunction · 0.85
prepCmdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…