mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
remove dependency on model
This commit is contained in:
parent
c5050ecabd
commit
ed93e0a2b0
32 changed files with 200 additions and 178 deletions
|
@ -38,6 +38,17 @@ func (self *Shell) RunCommand(cmdStr string) *Shell {
|
|||
return self
|
||||
}
|
||||
|
||||
func (self *Shell) runCommandWithOutput(cmdStr string) (string, error) {
|
||||
args := str.ToArgv(cmdStr)
|
||||
cmd := secureexec.Command(args[0], args[1:]...)
|
||||
cmd.Env = os.Environ()
|
||||
cmd.Dir = self.dir
|
||||
|
||||
output, err := cmd.CombinedOutput()
|
||||
|
||||
return string(output), err
|
||||
}
|
||||
|
||||
func (self *Shell) RunShellCommand(cmdStr string) *Shell {
|
||||
cmd := secureexec.Command("sh", "-c", cmdStr)
|
||||
cmd.Env = os.Environ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue