Skip to content

Commit

Permalink
Improve error messages for configurable merge tool arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Aug 5, 2021
1 parent 7b3e307 commit 0eb5348
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/cmd/mergecmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"os"
"strconv"
"strings"
"text/template"

Expand Down Expand Up @@ -85,8 +86,8 @@ func (c *Config) runMergeCmd(cmd *cobra.Command, args []string, sourceState *che
Target: string(targetStatePath),
}
args := make([]string, 0, len(c.Merge.Args))
for _, arg := range c.Merge.Args {
tmpl, err := template.New("").Parse(arg)
for i, arg := range c.Merge.Args {
tmpl, err := template.New("merge.args[" + strconv.Itoa(i) + "]").Parse(arg)
if err != nil {
return err
}
Expand Down

0 comments on commit 0eb5348

Please sign in to comment.