From c953871ec76528f638af8613d40051cd6c48be72 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 2 Oct 2022 18:42:51 -0700 Subject: [PATCH] use lowercase 'quote' for consistency with existing custom command template functions --- docs/Custom_Command_Keybindings.md | 2 +- pkg/gui/services/custom_commands/handler_creator.go | 2 +- pkg/integration/tests/custom_commands/form_prompts.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Custom_Command_Keybindings.md b/docs/Custom_Command_Keybindings.md index 09708d54c..62a034ecf 100644 --- a/docs/Custom_Command_Keybindings.md +++ b/docs/Custom_Command_Keybindings.md @@ -8,7 +8,7 @@ customCommands: command: 'hub browse -- "commit/{{.SelectedLocalCommit.Sha}}"' context: 'commits' - key: 'a' - command: "git {{if .SelectedFile.HasUnstagedChanges}} add {{else}} reset {{end}} {{.SelectedFile.Name | Quote}}" + command: "git {{if .SelectedFile.HasUnstagedChanges}} add {{else}} reset {{end}} {{.SelectedFile.Name | quote}}" context: 'files' description: 'toggle file staged' - key: 'C' diff --git a/pkg/gui/services/custom_commands/handler_creator.go b/pkg/gui/services/custom_commands/handler_creator.go index 9b30041e3..bad972bd6 100644 --- a/pkg/gui/services/custom_commands/handler_creator.go +++ b/pkg/gui/services/custom_commands/handler_creator.go @@ -168,7 +168,7 @@ func (self *HandlerCreator) getResolveTemplateFn(form map[string]string, promptR } funcs := template.FuncMap{ - "Quote": self.os.Quote, + "quote": self.os.Quote, } return func(templateStr string) (string, error) { return utils.ResolveTemplate(templateStr, objects, funcs) } diff --git a/pkg/integration/tests/custom_commands/form_prompts.go b/pkg/integration/tests/custom_commands/form_prompts.go index 4148c767a..5d9403107 100644 --- a/pkg/integration/tests/custom_commands/form_prompts.go +++ b/pkg/integration/tests/custom_commands/form_prompts.go @@ -17,7 +17,7 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{ { Key: "a", Context: "files", - Command: `echo {{.Form.FileContent | Quote}} > {{.Form.FileName | Quote}}`, + Command: `echo {{.Form.FileContent | quote}} > {{.Form.FileName | quote}}`, Prompts: []config.CustomCommandPrompt{ { Key: "FileName",