diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-11-02 16:39:15 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-11-05 07:58:21 +1100 |
commit | 802cfb1a0436568c72fc998249f10f8150b352a3 (patch) | |
tree | 599f8a8bd52b786312a11f3b3cac2a2d5b7c597e /pkg/gui/tasks_adapter.go | |
parent | 2fc1498517523a20a3080816ec50ee9e7fbe533d (diff) |
render commit graph
Diffstat (limited to 'pkg/gui/tasks_adapter.go')
-rw-r--r-- | pkg/gui/tasks_adapter.go | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/pkg/gui/tasks_adapter.go b/pkg/gui/tasks_adapter.go index 7e5089f6a..fad3e6284 100644 --- a/pkg/gui/tasks_adapter.go +++ b/pkg/gui/tasks_adapter.go @@ -1,6 +1,7 @@ package gui import ( + "io" "os/exec" "strings" @@ -20,18 +21,22 @@ func (gui *Gui) newCmdTask(view *gocui.View, cmd *exec.Cmd, prefix string) error manager := gui.getManager(view) - r, err := cmd.StdoutPipe() - if err != nil { - return err - } - cmd.Stderr = cmd.Stdout + start := func() (*exec.Cmd, io.Reader) { + r, err := cmd.StdoutPipe() + if err != nil { + gui.Log.Warn(err) + } + cmd.Stderr = cmd.Stdout - if err := cmd.Start(); err != nil { - return err + if err := cmd.Start(); err != nil { + gui.Log.Warn(err) + } + + return cmd, r } - if err := manager.NewTask(manager.NewCmdTask(r, cmd, prefix, height+oy+10, nil), cmdStr); err != nil { - return err + if err := manager.NewTask(manager.NewCmdTask(start, prefix, height+oy+10, nil), cmdStr); err != nil { + gui.Log.Warn(err) } return nil @@ -90,7 +95,6 @@ func (gui *Gui) getManager(view *gocui.View) *tasks.ViewBufferManager { view.Reset() }, func() { - // gui.g.Draw(view) // doing this causes an issue when there's a popup panel in front of the main view. gui.render() }, func() { |