1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-12-01 04:03:28 +03:00

add various interactive rebase commands

This commit is contained in:
Jesse Duffield
2019-02-18 23:27:54 +11:00
parent 76a27f417f
commit d44638130c
7 changed files with 178 additions and 39 deletions

View File

@@ -247,3 +247,19 @@ func (c *OSCommand) FileExists(path string) (bool, error) {
}
return true, nil
}
// RunPreparedCommand takes a pointer to an exec.Cmd and runs it
// this is useful if you need to give your command some environment variables
// before running it
func (c *OSCommand) RunPreparedCommand(cmd *exec.Cmd) error {
out, err := cmd.CombinedOutput()
outString := string(out)
c.Log.Info(outString)
if err != nil {
if len(outString) == 0 {
return err
}
return errors.New(outString)
}
return nil
}