MCPcopy Index your code
hub / github.com/jesseduffield/lazygit / RunShellCommand

Method RunShellCommand

pkg/integration/components/shell.go:71–89  ·  view source on GitHub ↗
(cmdStr string)

Source from the content-addressed store, hash-verified

69}
70
71func (self *Shell) RunShellCommand(cmdStr string) *Shell {
72 shell := "sh"
73 shellArg := "-c"
74 if runtime.GOOS == "windows" {
75 shell = "cmd"
76 shellArg = "/C"
77 }
78
79 cmd := exec.Command(shell, shellArg, cmdStr)
80 cmd.Env = self.env
81 cmd.Dir = self.dir
82
83 output, err := cmd.CombinedOutput()
84 if err != nil {
85 self.fail(fmt.Sprintf("error running shell command: %s\n%s", cmdStr, string(output)))
86 }
87
88 return self
89}
90
91func (self *Shell) CreateFile(path string, content string) *Shell {
92 fullPath := filepath.Join(self.dir, path)

Calls 2

failMethod · 0.80
SprintfMethod · 0.65

Tested by

no test coverage detected