mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
feat: allow OSCommand.Quote
to be invoked within a custom command
This commit is contained in:
parent
092363a986
commit
19df238b77
4 changed files with 9 additions and 21 deletions
|
@ -2,6 +2,7 @@ package custom_commands
|
|||
|
||||
import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/jesseduffield/generics/slices"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands"
|
||||
|
@ -166,7 +167,11 @@ func (self *HandlerCreator) getResolveTemplateFn(form map[string]string, promptR
|
|||
Form: form,
|
||||
}
|
||||
|
||||
return func(templateStr string) (string, error) { return utils.ResolveTemplate(templateStr, objects) }
|
||||
funcs := template.FuncMap{
|
||||
"Quote": self.os.Quote,
|
||||
}
|
||||
|
||||
return func(templateStr string) (string, error) { return utils.ResolveTemplate(templateStr, objects, funcs) }
|
||||
}
|
||||
|
||||
func (self *HandlerCreator) finalHandler(customCommand config.CustomCommand, sessionState *SessionState, promptResponses []string, form map[string]string) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue