mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
refactor
This commit is contained in:
parent
43a4fa970d
commit
95f4ceea34
7 changed files with 75 additions and 60 deletions
|
@ -12,9 +12,12 @@ type ICmdObj interface {
|
|||
AddEnvVars(...string) ICmdObj
|
||||
GetEnvVars() []string
|
||||
|
||||
// runs the command and returns an error if any
|
||||
Run() error
|
||||
// runs the command and returns the output as a string, and an error if any
|
||||
RunWithOutput() (string, error)
|
||||
RunLineOutputCmd(onLine func(line string) (bool, error)) error
|
||||
// runs the command and runs a callback function on each line of the output. If the callback returns true for the boolean value, we kill the process and return.
|
||||
RunAndProcessLines(onLine func(line string) (bool, error)) error
|
||||
|
||||
// logs command
|
||||
Log() ICmdObj
|
||||
|
@ -60,6 +63,6 @@ func (self *CmdObj) RunWithOutput() (string, error) {
|
|||
return self.runner.RunWithOutput(self)
|
||||
}
|
||||
|
||||
func (self *CmdObj) RunLineOutputCmd(onLine func(line string) (bool, error)) error {
|
||||
return self.runner.RunLineOutputCmd(self, onLine)
|
||||
func (self *CmdObj) RunAndProcessLines(onLine func(line string) (bool, error)) error {
|
||||
return self.runner.RunAndProcessLines(self, onLine)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue