1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

shell out custom commands

This commit is contained in:
Jesse Duffield
2021-04-01 20:10:24 +11:00
parent 8af3fe3b4a
commit e8e59306fc
3 changed files with 26 additions and 20 deletions

View File

@ -492,6 +492,13 @@ func (gui *Gui) PrepareSubProcess(command string) {
})
}
func (gui *Gui) PrepareShellSubProcess(command string) {
gui.SubProcess = gui.OSCommand.PrepareShellSubProcess(command)
gui.g.Update(func(g *gocui.Gui) error {
return gui.Errors.ErrSubProcess
})
}
func (gui *Gui) editFile(filename string) error {
_, err := gui.runSyncOrAsyncCommand(gui.GitCommand.EditFile(filename))
return err
@ -798,7 +805,7 @@ func (gui *Gui) handleCustomCommand(g *gocui.Gui, v *gocui.View) error {
return gui.prompt(promptOpts{
title: gui.Tr.CustomCommand,
handleConfirm: func(command string) error {
gui.SubProcess = gui.OSCommand.RunCustomCommand(command)
gui.SubProcess = gui.OSCommand.PrepareShellSubProcess(command)
return gui.Errors.ErrSubProcess
},
})