ensure sprig funcs are mapped for files
This commit is contained in:
parent
06da4ca080
commit
81fdd9a413
4
main.go
4
main.go
@ -266,13 +266,13 @@ func main() {
|
|||||||
tplFiles := expandFiles(flag.Args())
|
tplFiles := expandFiles(flag.Args())
|
||||||
// Otherwise use the provided tplFiles/directories for templates to render.
|
// Otherwise use the provided tplFiles/directories for templates to render.
|
||||||
// fmt.Fprintf(os.Stderr, "%+v\n", tplFiles)
|
// fmt.Fprintf(os.Stderr, "%+v\n", tplFiles)
|
||||||
tpl, err = template.ParseFiles(tplFiles...)
|
tpl, err = tpl.ParseFiles(tplFiles...)
|
||||||
checkErr(err)
|
checkErr(err)
|
||||||
for i, file := range tplFiles {
|
for i, file := range tplFiles {
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
fmt.Println(flags.outputDelimiter)
|
fmt.Println(flags.outputDelimiter)
|
||||||
}
|
}
|
||||||
checkErr(tpl.ExecuteTemplate(os.Stdout, filepath.Base(file), values))
|
checkErr(tpl.Funcs(sprig.FuncMap()).ExecuteTemplate(os.Stdout, filepath.Base(file), values))
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user