mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-31 23:19:40 +02:00
support custom command loading text
This commit is contained in:
parent
8a59a4404b
commit
7cd17d3a73
@ -72,7 +72,11 @@ func (gui *Gui) handleCustomCommandKeybinding(customCommand CustomCommand) func(
|
||||
return nil
|
||||
}
|
||||
|
||||
return gui.WithWaitingStatus(gui.Tr.SLocalize("runningCustomCommandStatus"), func() error {
|
||||
loadingText := customCommand.LoadingText
|
||||
if loadingText == "" {
|
||||
loadingText = gui.Tr.SLocalize("runningCustomCommandStatus")
|
||||
}
|
||||
return gui.WithWaitingStatus(loadingText, func() error {
|
||||
gui.OSCommand.PrepareSubProcess(cmdStr)
|
||||
|
||||
if err := gui.OSCommand.RunCommand(cmdStr); err != nil {
|
||||
@ -188,11 +192,12 @@ type CustomCommandPrompt struct {
|
||||
}
|
||||
|
||||
type CustomCommand struct {
|
||||
Key string `yaml:"key"`
|
||||
Context string `yaml:"context"`
|
||||
Command string `yaml:"command"`
|
||||
Subprocess bool `yaml:"subprocess"`
|
||||
Prompts []CustomCommandPrompt `yaml:"prompts"`
|
||||
Key string `yaml:"key"`
|
||||
Context string `yaml:"context"`
|
||||
Command string `yaml:"command"`
|
||||
Subprocess bool `yaml:"subprocess"`
|
||||
Prompts []CustomCommandPrompt `yaml:"prompts"`
|
||||
LoadingText string `yaml:"loadingText"`
|
||||
}
|
||||
|
||||
func (gui *Gui) GetCustomCommandKeybindings() []*Binding {
|
||||
|
Loading…
x
Reference in New Issue
Block a user